Message Box Response

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can't seem to get this to work. What am I missing here. It seems like my code never gets to line9: ?
TI

Sub Anothercert(
Dim msbantc As Strin
msbantc = MsgBox("Do you want to make another certificate?", vbYesNo
If msbantc = vbYes The
GoTo line
ElseIf msbantc = vbNo The
GoTo line
Exit Su
End I
End Su
Sub yes(
line8
Call Save_Close_Ne
End Su
Sub no(
line9
Call Save_Clos
End Su
 
Hi Greg
unteted but try something like the following

Sub Anothercert()
Dim msbantc
msbantc = MsgBox("Do you want to make another certificate?", vbYesNo)
If msbantc = vbYes Then
Call Save_Close_New
else
Call Save_Close
End If
End Sub
 
Sub test()
Select Case MsgBox("Do you want to make another certificate?", vbYesNo)
Case vbYes: Save_Close_New
Case vbNo: Save_Close
End Select
End Sub
 
? typename(vbYes)
Long
? typename(vbNo)
Long



Sub Anothercert()
Dim msbantc As Long
msbantc = MsgBox("Do you want to make another certificate?", vbYesNo)
If msbantc = vbYes Then
Yes
ElseIf msbantc = vbNo Then
No
Exit Sub
End If
End Sub
Sub yes()
Call Save_Close_New
End Sub
Sub no()
Call Save_Close
End Sub

Just "call" the subs. Labels are local to the procedure I believe.
 
Perhaps not qualified to comment, but:
'#Not Tested'
You appear to have just two results, either vbYes or
vbNo.

Why not avoid the call to subs, and say:

If MsgBox("Do you want to make another certificate?", vbYesNo) = vbYes
Then
'do something
Else '=vbNo
'do other things
End If
 
I will not include all of your responses but I thank you all for help. I have not tried any of these suggestions yet but I know that they will work. You have no idea the time that I wasted today trying to figure thisout before coming here. Thanks again
Greg
 

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

Back
Top