Yes No box no working properly

M

Miree

I have a section of code which brings up the meassage box
but it doesnt matter what i select it always shows Results saved, Can
someone show me how to fix this so that if i select no it exits the sub and
shows Results NOT saved

Response = MsgBox("Do All results have a Formulation Number", vbYesNo)
??If Response = "" Then MsgBox ("Results NOT saved")

ResultsDatabase1
ResultsDatabase2

MsgBox ("Results saved")

Thanks
 
T

The Code Cage Team

This is what you need:
Response = MsgBox("Do All results have a Formulation Number", vbYesNo)
If Response = vbNo Then
MsgBox ("Results NOT saved")
Else
ResultsDatabase1
ResultsDatabase2
MsgBox ("Results saved")
End If

Regards,
The Code Cage Team
www.thecodecage.com/forumz
 
S

st

Miree said:
I have a section of code which brings up the meassage box
but it doesnt matter what i select it always shows Results saved, Can
someone show me how to fix this so that if i select no it exits the sub and
shows Results NOT saved

Response = MsgBox("Do All results have a Formulation Number", vbYesNo)
??If Response = "" Then MsgBox ("Results NOT saved")

ResultsDatabase1
ResultsDatabase2

MsgBox ("Results saved")

if (Responce=vbYes) then
resultsDatabase1: resultsDatabase2
endif
 

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