Message Box? How to Respond to Yes, No

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
 
P

PC Datasheet

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
 
D

Damonj

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
 

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