Save entire record at once

spock1971

Registered User.
Local time
Today, 12:29
Joined
Nov 14, 2004
Messages
80
Hi Guys

I have a main table, which I then query specifying 'XXX' in multiple fields to bring back no records. Then I set up a form based on that query so I always have a blank form to enter details to the table.

Access is saving the record every time I amend a field. I'm now stipulating that many of the fields must have data in and am repeatedly getting the 'field name must not be zero' error message even when I'm nowhere near that field.

I need to disable autosave and then put the docmd.acsave etc once all fields are complete.

Any ideas how best to do this?
 
Searching the forum is a great way to discover and learn the answers to your Access programming questions.

Access will save the current record when you move to another record. You need to use the forms BeforeUpdate event to validate your data before allowing the record to be saved.

These should give point you in the right direction...

A Better Mouse Trap?

Enable/Disable The Control Box X Button
 
Before I go exploring your links perhaps I didn't explain myself clearly.

I'm not navigating between records, just fields of a record. i.e. I record is name, date, grade etc and all are set to expect data entered.

If I click in name an error message pops up saying date can't be a zero field.

Therefore I need to turn off the auto save between name, date and grae until the end, then when I click next record - validate all 3 boxes.

Cheers

D
 
Ok - after further investigation access isn't storing after every field is left. Only the dropdown combo boxes.

These boxes are doing select distinct queries from other tables within the database if that makes any difference.

When I leave a combo field, the record is saved to the main table.

Shed any light to anyone?
 
Ok - there's a lot of it. And it isn't just the combo boxes after all. As soon as I click the first box, a new ref number is created and a record appears in the table.
 

Attachments

Why are you using the Refresh method? That is what is saving your current record. Using the built-in Access VBA help will enlighten you with your programming questions. This is the same info you would find if you were to hi-lite the Refresh command in your code and press the F1 key... Refresh Method
 
Thanks all

I was using it because the select distinct sql code in the cascading combo boxes wasn't working without it.
 
How about a form with unbound controls with a button that will have a "INSERT INTO" command ?
 

Users who are viewing this thread

Back
Top Bottom