Open the Immediate Window (Ctrl+G), and enter:
? Typename(MsgBox("Continue?", vbYesNoCancel))
You will see that MsgBox() returns a Long.
Therefore you need to declare:
Dim RetValue As Long
BTW, your might find it easier to understand your code if you use the
vbMsgBoxStyle constants, e.g.:
If RetValue = vbYes Then ...
You can see these values if you press F2 to open the ObjectBrowser, and
search on vbYes.
The "Select Case" construct might help too:
Select Case MsgBox("Continue?", vbYesNoCancel+vbExclamation, "Edit
Suppliers")
Case vbYes
...
Case vbNo
...
Case vbCancel
...
End Select

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> After being about 95% complete on my application, I realized that Option
> Explicit shouldl be set on all forms. I went back and did that. Thankfully
[quoted text clipped - 18 lines]
> 'DoCmd.CancelEvent
> 'End If
MBoozer - 30 Nov 2005 07:31 GMT
Thanks Allen! Works great. Appreciate it.
> Open the Immediate Window (Ctrl+G), and enter:
> ? Typename(MsgBox("Continue?", vbYesNoCancel))
[quoted text clipped - 43 lines]
> > 'DoCmd.CancelEvent
> > 'End If