1.

Solve : clearing all textboxes in a form?

Answer»

I have googled to find a code in VB2008 to clear all textboxes in a form. I can't seem to GET a code to work. If your textbox its badly name as txtbox1 txtbox2, 3, 4, 5 and so on then you can use this code

For i = 0 to txtbox_ammount
Dim str = "txtbox" & i + 1
Me.controls(str).text = ""
next

This would clear all your txtbox but BAD naming conventionDoes VB2008 really spell "ammount" like that? With 2 'm's?
I'm not sure what the code is in VB but if it doesn't work you can simply overwrite the text fields with empty strings wherever needed. Not the most efficient way to go but if it WORKS, also DEPENDING what it is you're working on.



Discussion

No Comment Found