New record

Super Suarez

Registered User.
Local time
Today, 11:40
Joined
Jul 10, 2013
Messages
36
Hi All,

How do I make the windows default navigation work to the following:-

Next record that navigates to next, but does not create a new record when at EOF

New record that creates a new record.

I've tried turning off 'Allow additions' for the form, but that turns off the 'New Record' button, so that's not right

Perhaps it's me but the default way in which the navigation buttons work is strange. I would have thought the next button would only go next and wouldn't do new. That's what I'm after.

Hope you can help
 
You need the Allow Additions to be Yes, so new data can be entered. Have you placed any manual code that will detect EOF and do otherwise.

When you say it does not create new record, do you mean even if you enter information, it is not updated in the table?
 
Navigating to the "new" record does not actually create one. You (or the user) must first dirty the record. If your user isn't doing it, then your own code is the culprit. Be very careful to avoid running code that dirties a record before the user does. If you want to set values do NOT do it until the BeforeInsert event. That event runs only once and it doesn't run until the user types the first character in a new record. The dirty event is a possibility but it runs for both changes and inserts so your code may need to check to see if it is a new record and run different code for new records than for changed records. No other event should even be considered.
BeforeInsert event - you only want the code to run for a new record.
BeforeUpdate event - the code should run for both new and changed records.
onDirty event - the code should run for both new and changed records.
 

Users who are viewing this thread

Back
Top Bottom