wa*****@gmail.com wrote:
I have a client who wants to have Access ask to save changes anytime
data is changed or added into the database. I'm not really an Access
guy, I actually run their servers, but have been dropped into the roll
because I have some understanding of it. Any help would be greatly
appreciated, they have me on a serious time line and I've been pulling
my hair out all day over this. Thanks in advance.
-Walter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Walter,
My condolences. You should tell the cheapskates to hire an Access
developer. I knew of another network admin who agreed to work on an
Access project - blew the project & then quit in a huff.
Anyway... your problem can be solved in a number of ways.
Usually, when a user finishes entering data & closes the form or moves
to another record, the current record is saved (or attempted). This
attempt runs the Form's BeforeUpdate event. That is an ideal place to
have a "Save?" dialog. Here's how:
Open the form in Design view.
Open the form's Properties dialog box (double-click on the form).
On the main menu bar click: View > Code.
There are 2 "drop-down" boxes in the top of the VBA module, click on the
left-hand one and select Form.
Click on the right-hand drop-down box & select BeforeUpdate, the cursor
will move to the event procedure.
Enter this code inside the Sub:
Const MSG_SAVE = "Save this Record?"
Dim intAnswer As Integer
intAnswer = MsgBox(MSG_SAVE, vbQuestion+vbYesNoCancel, "Save Record")
Select Case intAnswer
Case vbNo: Me.Undo
Case vbCancel: Cancel = True
' Case Else: Do nothing, which = Yes, save the record
End Select
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQjHmyoechKqOuFEgEQK8XQCfWZ9R6IjMLkdUhHogi8Z8SG iJa7AAoJgL
z3jEC+ouJwxMLXwlx0/pRjyi
=Gnhm
-----END PGP SIGNATURE-----