Clear form fields

N

netadmin

I would like to know what code I could place on a command
button called submit that after a user has filled in the
required data and selects the submit button the data is
stored in database and the fields in the form are
cleared. Any help would be appreciated.

Thanks
 
A

Arvin Meyer

netadmin said:
I would like to know what code I could place on a command
button called submit that after a user has filled in the
required data and selects the submit button the data is
stored in database and the fields in the form are
cleared. Any help would be appreciated.

Aircode:

Dim ctl as Control
For each ctl in formname.Controls
If ctl.ControlType = actextbox or ControlType = accombobox Then
ctl.Value = Null
End If
Next
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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

Top