Clearing all the entries from form when

  • Thread starter Thread starter elli
  • Start date Start date
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-
 
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
 
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-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top