Toggling Me.AllowAdditions

MikeAngelastro

Registered User.
Local time
Today, 01:13
Joined
Mar 3, 2000
Messages
254
Hi,

I have a form where I have Me.AllowAdditions is set to False at load time. The form also has a button that changes Me.AllowAdditions to True to allow users to add records; the button then becomes a "Disable Record Additions" button earmarked for when the user has added all the records planned. However, I would also like to give users the ability to change their minds. When they click the button to disable record additions, and a key field is null, as soon as VBA changes Me.AllowAdditions to False I get an error. I think it's because Access is trying to store the record in the table when not all the conditions for table records are met. The error code is 3101 and I'm having difficulty figuring out how to prevent the attempt to store the record and thus avoid the error.
 
What you're doing is way beyond anything I do but if it helps here's what error 3101 is:

The Microsoft Jet database engine can't find a record in the table '|2' with key matching field(s) '|1'.

hopefully that will give you a clue
 
Try Me.Undo or SendKeys {"ESC"} {"ESC"}
 

Users who are viewing this thread

Back
Top Bottom