Saving Records

  • Thread starter Thread starter mon
  • Start date Start date
M

mon

Hi Again, I am finding that it is too easy to accidently
enter a record. How do I make a save Button so that it
has to be actioned before the record is saved.
Thanks Mon
 
Mon,
Set the Form Properties "AllowAdditions" to "No".
In the button Click event code:
Me.AllowAdditions = True
Either in the From Current event or the Form AfterUpdate
event you can reset the property by coding:
Me.AllowAdditions = False

OR

In the Form BeforeUpdate event you can code a "MsgBox" and
ask "Do you know your adding another record, Stupid???".
You can then set the BeforeUpdate "Cancel" argument
to "False" to inhibit the saving to the data.

Ron
 
Hi Again, I am finding that it is too easy to accidently
enter a record. How do I make a save Button so that it
has to be actioned before the record is saved.
Thanks Mon

You can do this with a little VBA code. Define a global variable by
putting

Public bOKToSave As Boolean

in the Form's Module, at the top before any Sub lines. Set bOKToSave
to False in the Form's Current event; to True in the Save button code;
and in the Form's BeforeUpdate event put

If bOKToSave Then
MsgBox "Please use the Save to save the record", vbOKOnly
End If
 
Non of this is working for me (Sorry)
-----Original Message-----
Mon,
Set the Form Properties "AllowAdditions" to "No".
In the button Click event code:
Me.AllowAdditions = True
Either in the From Current event or the Form AfterUpdate
event you can reset the property by coding:
Me.AllowAdditions = False
###I've done all this (thank you for the code), but all I get is a totally blank form.
OR

In the Form BeforeUpdate event you can code a "MsgBox" and
ask "Do you know your adding another record, Stupid???".
You can then set the BeforeUpdate "Cancel" argument
to "False" to inhibit the saving to the data.
#### What is the code for Cancel argument?
Thanks Mon
 
Thanks for your help
Absolutely nothing is working for me
Now the Public goes into the General section
(Declearation)?
Public bOKToSave As Boolean
Is "Me.bOKToSave = False" the correct statement?
 
Thanks for your help
Absolutely nothing is working for me
Now the Public goes into the General section
(Declearation)?

Please post the actual code that you are using.
 
Back
Top