Add records when button clicked only

G

Guest

I have taken the navigation buttons from the form and would like to move all
the submit\update\add new record to a command button.

The command button is fine, it works, but the form still moves onto a new
record using the enter key. I would rather the records stay put until it is
told to update and bring up a new record by the button click.

Is there anyway that I can turn off these actions??

I hope that this is clear enough.
 
A

Allen Browne

Set the form's Cycle property to:
Current Record
That will prevent Enter or Tab moving you to a new record.

However, there are still many ways that a record can be saved.
Some examples:
- pressing Shift+Enter
- choosing Save Record on the Records menu
- applying a filter
- changing the sort order
- requerying the form
- changing its RecordSource property
- closing the form
- closing Access
and so on.

The only way you can catch them all in a bound form is to use the
BeforeUpdate event of the form.

Depends on your reasons, but you may be better served to learn how to work
with the events Access fires for you, rather than trying to design straight
jackets to force your user into.
 
G

Guest

Seems sensible.
This is fine for now. I am likely to change design at some point as
specification changes, but from the viewpoint at present, this is the more
obvious way forward.

Its not really that I am trying to force the user one way when they want to
go another or the system wants to go another, its just that the user only has
one entry at a time, and the way the forms are set up (at this point) tries
to enter more and more entries using the same primary key, and that is not
allowed.

Thanks for the input. It'll give me something to think about.
 

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