Reset button

L

Louisa Ray

I have a form that employees will use to place food orders. How do I add a
button to the form that will say 'reset' and when it is clicked, will clear
out what the users have entered into the form?

Thanks for any assistance.

Louisa Ray
 
P

Proko

Hi Louisa,
In the forms design mode, add a button. Add the following code to the
button's 'On Click' event.

Dim ctl As Control
On Error Resume Next
For Each ctl In Me.Controls
ctl.Value = Null
Next ctl

Hope this helps!
Proko
 
L

Louisa Ray

When I add that as the code and test it, I am getting an error message. Is
there anyway you could send me a screenprint of exactly what it is supposed
to look like?
 
J

John W. Vinson

I have a form that employees will use to place food orders. How do I add a
button to the form that will say 'reset' and when it is clicked, will clear
out what the users have entered into the form?

Thanks for any assistance.

Louisa Ray

If you want to erase forever what has been typed into the form, but not yet
saved to the database, put

Me.Undo

in the button's [Event Procedure].

If you just want to save the record and move to a new, blank record, either
click the builtin *> new record button on the navigation toolbox, or program
your own with a line

DoCmd.GoToRecord,,,acNewRecord
 

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