View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Returning control to form

Hi Dileepan,

What the user exits the message box, which by the way you can test for
response, then control continues. So your form gets it automatically.

If nSeasons = 0 Then
ans = MsgBox(" Seasons caqnnot be zero!", vbOKCancel)
If ans = vbOK Then
'do one thing
Else
'do another
End If
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"P. Dileepan" wrote in message
...
Hi,

I am not a VBA programmer. My question may be too
simple, but I am stuck. Please help.

In my code I check whether user input is valid or not.
Somethig like this:

If nSeasons = 0 Then ErrMsg1 = Seasons caqnnot be zero!"
If ErrMsg1 < "" Then MsgBox (ErrMsg1)

How do I make the code execution to put the control back
to the form so that the user can either cancel or give
valid input?

-- Dileepan