Cycle records - Mouse Wheel

A

Andy

I have a form which has a Go To New Record action on open event.

The form is based on a table so as the form is opened it goes to a new
record as expected. The form is set to cycle on current record only but if
you use the mouse wheel it is still possible to cycle to earlier records in
the table.

Is there a way to prevent this and stay on the new record?

Also - if someone starts to fill in some data for this new record but then
decides to cancel is there a neat way to stop any data being saved rather
than putting lots of code into the Close Form event.

Thanks for any suggestions.
 
A

Allen Browne

Does opening the form in DataEntry mode work? Set the form's Data Entry
property to Yes, or if you open the form programmatically use this kind of
thing:
DoCmd.OpenForm "Form1", DataMode:=acFormAdd

For the last part of your question, use the BeforeUpdate event of the form
to perform any checks you wish. You can cancel the event if you are not
happy.

Form_Close is too late (i.e. the record has already been saved at that
time.)
 
A

Andy

Thanks - Excellent.

Allen Browne said:
Does opening the form in DataEntry mode work? Set the form's Data Entry
property to Yes, or if you open the form programmatically use this kind of
thing:
DoCmd.OpenForm "Form1", DataMode:=acFormAdd

For the last part of your question, use the BeforeUpdate event of the form
to perform any checks you wish. You can cancel the event if you are not
happy.

Form_Close is too late (i.e. the record has already been saved at that
time.)
 

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