Multiple Forms

froggiebeckie

Registered User.
Local time
Today, 10:58
Joined
Oct 11, 2002
Messages
104
I found some code on here that requires user verification before creating new records in a form. I placed this in the BeforeUpdate event.

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not (Me.NewRecord) Then
 If MsgBox("Would You Like To Save The Changes To This Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save Changes to Record ???") = vbNo Then
  Me.Undo
 End If
Else
 If MsgBox("Would You Like To Save This New Record?", vbQuestion + vbYesNo + vbDefaultButton1, "Save This Record ???") = vbNo Then
  Me.Undo
 End If
End If
End Sub

This works perfectly on the first form, but I have several different forms for entering/editing records in different tables.

My question is, what's the simplest way to apply this to all my data entry forms?

Thanks, in advance.
 
...put it in the BeforeUpdate event of all of your data entry forms?? :confused:

There's no field names or form-specific code there, so it should be totally portable. I'm not sure why you want to do this, as in my experience users often click the wrong thing when presented with extra choices.
 
I agree with David- it looks portable.
But have you tested this with users? Are they happy with having to respond to each use of every form?
 
I'm trying to avoid having a bunch of incomplete or bogus records created.
Also trying to slow them down before they change an existing record.

The forms all open to a new record and without this code, anything they put in any of the fields will cause a new record to save.
Can't require all fields be completed before saving, because not all records will always have all fields filled in.
Haven't checked with the users, yet.

They are mostly Exel folks, and will have a short learning curve before settling in with Access. Once they get used to navigating around and are comfortable with what they need to do, I can change it, if they don't like it.

Thanks so much for looking and commenting.
 

Users who are viewing this thread

Back
Top Bottom