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
 
Top