Access: Save Record Message prior to next record possible or reco.

D

Douglas J. Steele

Records are automatically saved when you leave the record. There's no way to
change this default behaviour, unless you want to get into complicated
scenarios where you have unbound forms and write the records to the database
in code.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Le said:
When you close other microsoft applications.. it will have a popup that says
"do you want to save changes to xyz" is this possible from one record to
another in Acces.. ie.. in a form.. please respond to [email protected] or
[email protected].. thanks.

Sorry, but that's not how newsgroups work. When you post your question in a
newsgroup, you come back to the newsgroup to get the answer.
 
A

Allen Browne

Use the BeforeUpdate event procedure of the form for confirmation before the
record is committed:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If MsgBox("Save?", vbOkCancel) = vbCancel Then
Cancel = True
'Me.Undo
End If
End Sub

BTW, we don't respond to email addresses, and it is not a good idea to post
your address here as spambots scour the groups.
 
J

John Vinson

When you close other microsoft applications.. it will have a popup that says
"do you want to save changes to xyz" is this possible from one record to
another in Acces.. ie.. in a form.. please respond to [email protected] or
[email protected].. thanks.

If you do all your updating using a Form, you can put VBA code in the
Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Dim iAns As Integer
iAns = MsgBox("Do you want to save changes to xyz?", vbYesNo)
If iAns = vbNo Then
Cancel = True
End If
End Sub

If you're using a table datasheet you're out of luck, it has no usable
events. Also, in most database applications this kind of prompt would
become EXTREMELY annoying - a user might be inserting hundreds of
records!

Note that private EMail support is reserved for paying customers. It's
considered polite to come back to the newsgroup for your answers,
rather than demanding personal support from unpaid volunteers. Please
reply *to the newsgroup* if you have further questions (email replies
will be billed at my standard consulting rate).

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Top