Command button to reset form for fresh entry?

G

Guest

Hello,

I have a large form for accident reporting on which users enter a great deal
of information. For the sake of simplicity I have it set up so that users can
only use the form to enter a new report rather than view previous reports.

As it is set up now I have several command buttons at the bottom of the form
for 1)Saving the data, 2)Preview/Print data in report form and 3)Close the
form to return to the switchboard. If users have to fill out more than one
accident report they now have to complete one report, close out of the form,
go back to the switchboard and re-open to a "blank" form.

Is there a way I can put a command button at the bottom of the form that
will do the following:
-close out of the form with the current data
-reopen/refresh to a "blank" form without allowing access to previously
entered accident data (including the one the user might have just closed out
of)

Thanks for the help,
David
 
W

Wayne Morgan

If you set the form's Properties to Data Entry = Yes and Allow Edits = No
then they will be able to add new records but not edit existing records,
including the records they just entered. They will still be able to see
those records, but they can't edit them. Once the form is closed, they won't
see those records either, just as you have it now.

If you don't want them to be able to see them either, then in the form's
AfterUpdate event place the code line

Me.Requery

This will requery the form after they save the record they just entered. If
Date Entry is set to Yes, this will hide all records except for the current,
new record.
 
G

Guest

Thanks so much Wayne. You came to the rescue again! I actually created a
command button and put Me.Requery in the OnClick event.

Works like a dream...

David
 

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