Answer to Question #39960 in Visual Basic for glenn

Question #39960
hello sir/ma'am. I really need to know this, it is possible to address all the textbox in vb.net and replace the single qoute to double qoute? because i'm having problem on inserting data in ms access.. this is my current codes :

Public Sub singleqoute()
Dim ctrl As Control
Dim txt As TextBox

For Each ctrl In ManageItems.Controls
If TypeOf ctrl Is TextBox Then
txt = CType(ctrl, TextBox)
txt.Text = txt.Text.Replace("'", "''")
End If
Next
For Each ctrl In ManageBorrowers.Controls
If TypeOf ctrl Is TextBox Then
txt = CType(ctrl, TextBox)
txt.Text = Replace(txt.Text, "'", "''")
End If
Next
For Each ctrl In ManageTransactions.Controls
If TypeOf ctrl Is TextBox Then
txt = CType(ctrl, TextBox)
txt.Text = Replace(txt.Text, "'", "''")
End If
Next

End Sub
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS