VBYesNo problem...

WinDancer

Registered User.
Local time
Today, 15:13
Joined
Oct 29, 2004
Messages
290
Why does this code not branch when the user chooses no at the msgbox?
********************************************

Private Sub Command6_Click()

'Already A survey for this employer?
If DCount("*", "qryCheckForPreviousSurvey") > 0 Then
MsgBox "A survey for this account number already exists. Would you like to go ahead anyway?", vbYesNo
End If

If vbYesNo = vbNo Then GoTo LastLine

' tell the user that you are working
DoCmd.OpenForm "frmPreLoadWait"

******************************************
There is a line at the end of the code, just before end sub,
"LastLine :"

Thanks,
Dave
 
it should be

if msgbox("myquestion",vbyesno) = vbno then
'code for negative response here
end if
 
That works :)
Thanks
Dave
 

Users who are viewing this thread

Back
Top Bottom