hi, anyone know how clear all textbox in array? plz read for more detail.

03-17-2006, 02:16 PM
for example, i have a customer form and the form is used to fill out the customer data. the form has about 20-30 text box(just an example).
it would be ****ed to look at the every control's name and type controlname.text ="" and the code would end up 30 lines =.=...
so it's not good.
if i do this way, it's little slow also.
so, anyone know how to do control array to clear all the textbox in few code?

03-17-2006, 02:20 PM
You can iterate through the controls on your form and clear the textboxes.

For Each ctl As Control In Me.Controls
If TypeOf ctl Is TextBox Then CType(ctl, TextBox).Clear

03-17-2006, 02:36 PM
wow.. that's nice.
thank you. it works pretty good.
u are smart =p

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum