vbYesNo add timer

L

lmv

How do I have the following automatically default to "yes save changes" and
close after a few seconds?

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "Do you want to SAVE changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then

Else
Me.Undo
Cancel = True
End If
End Sub
 
D

Douglas J. Steele

While you can default a button with the built-in MsgBox, it's really not
intended to be closed automatically.

You'd be best off creating your own form that looks like a message box and
control it.

You could also take a look at my May, 2005 "Access Answers" column in
Pinnacle Publication's "Smart Access". You can download the column (and
sample database) for free at
http://www.accessmvp.com/djsteele/SmartAccess.html Not sure I'd really
recommend using that technique in a production application though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top