AllowAdditions updates record?

K

kagard

Greetings:

I have a form that opens with AllowAdditions set to false. When the
user clicks the Add command button, I set AllowAdditions to true, move
to a new record, and set AllowAdditions back to false. Trouble is,
setting AllowAdditions to false apparently causes Access to try to
save the new record, which in turn throws a key violation error
because the user hasn't entered any data yet.

1. Am I correct in assuming the changing the AllowAdditions property
triggers an update?

2. Is there a way to disallow additions without Access trying to save
the new record?

TIA

Keith
 
S

storrboy

1. Am I correct in assuming the changing the AllowAdditions property
triggers an update?

Yes. The form uses those properties to efectively apply 'record
locking' to the recordset. If you change the property, the recordset
must be refreshed with the new locking rules. In order to refresh, all
updates must be completed or cancelled.
2. Is there a way to disallow additions without Access trying to save
the new record?

Wait until the user saves the new record - either by comand button or
the AfterUpdate event.
 
K

kagard

Yes. The form uses those properties to efectively apply 'record
locking' to the recordset. If you change the property, the recordset
must be refreshed with the new locking rules. In order to refresh, all
updates must be completed or cancelled.




Wait until the user saves the new record - either by comand button or
the AfterUpdate event.

Perfect!, Thanksstorrboy.

Keith
 

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