Clearing all the entries from form when

E

elli

How do I get all the textboxes cleared when I leave the form or click the
button?

Tried almost anything and still the last username put to form stays on and
on....



-elli-
 
K

Ken Sheridan

Elli:

Presumably this is an unbound form. Try this:

Dim ctrl As Control

' ignore error if control does not have Value property
OnError Resume Next
' loop through form's Controls collection and set each to Null
For Each ctrl In Me.Controls
ctrl = Null
Next ctrl

Ken Sheridan
Stafford, England
 
E

elli

Hi Ken and thanks for a quick reply...
It is an anbound form and your piece of code seems to work allright.
Thank U!
Take care -elli-
 
Top