Message Box? How to Respond to Yes, No

  • Thread starter Thread starter damonj
  • Start date Start date
D

damonj

Hi All,
Running Access 2002 on WinXP Pro.

I have the following code for a message box;

MsgBox ("Is all data for Flint Cross Reference Number "
& Me.FLINTNO _
& " correct before posting? "), vbYesNo, "Verify
Entry"

What I would like to happen is this;
If a user clicks Yes, the recorded gets saved,
a new message box appears and says. " The record has been
posted."
and the form moves to a blank record, ready to accept new
information.

If a user selects No, then I want them to be able to go
back to the form and make any needed changes.

Many thanks,
Damon
 
Dim MsgStr As String
Dim TitleStr As String
MsgStr = "Is all data for Flint Cross Reference Number "
TitleStr = "Verify Entry"
If MsgBox(MsgStr,vbYesNo,TitleStr) = vbNo Then
<<Your code to go back to the form and make any needed changes>>
Else
<<Your code to save the record, raise a new message box appears and says. "
The record has been
posted." and the form moves to a blank record, ready to accept new
information.>>
End If
 
Thanks Great Mask Access Crusader, wherever you are.
You've saved the day and another befuddled Access user is
back on track!!

Thanks again,
Damon
 
Back
Top