View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_4_] Jim Thomlinson[_4_] is offline
external usenet poster
 
Posts: 1,119
Default Simple message Yes No...

You have a couple of small problems here. You are using gotos when they
really are not appropriate (other than error handling they never are). Also
you have 2 if statements and only one end if. It should look more like this...

public sub Whatever

if msgbox("Do you want to undo the last entry?", vbYesNo, _
"Undo Entry") = vbYes Then
Call Account_Undo
else
Call Bye
end if
end sub
--
HTH...

Jim Thomlinson


"jmhadp" wrote:


Below is my attempts at basic VB

Dim lngUserChoice As Long
lngUserChoice = MsgBox("Do you want to Undo last entry?", _
vbYesNo + vbQuestion, "Undo Last Entry")
If lngUserChoice = vbYes Then
GoTo Account_undo
If Response = vbNo Then GoTo Bye
End If
End Sub

I am getting an error message Compile Error: Label Not Defined...I
figure this is a basic step I am missing...I am trying to get a message
button to go forward with the Macro Account_undo if yes and if no
end...don't execute...

I appreciate your help.


--
jmhadp
------------------------------------------------------------------------
jmhadp's Profile: http://www.excelforum.com/member.php...o&userid=25340
View this thread: http://www.excelforum.com/showthread...hreadid=388196