View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jenn Jenn is offline
external usenet poster
 
Posts: 3
Default MsgBox execution sends program into design mode

Hello

This is my code:
'Checks to see if work order # was entered correctly in textbox1, if not it gives error message and sends
'user back to textbox1

WOVar = MainForm.TextBox1.Valu
Response2 = (WOVar Like "####"

Do While Response2 = Fals

promptvar = "The Work Order # was typed incorrectly, please retype, Example: 4160
CheckVar = MsgBox(promptvar, vbCritical + vbOKOnly, "Continue"
If CheckVar = 1 Then MainForm.TextBox1.SetFocu
En
Response2 = (WOVar Like "####"

Loo

This is executed from a module, public sub, mainform is the userform where textbox1 is. When this code is executed the message box works correctly, but when you hit ok the program does not continue, instead it pops out of "run" mode into "design" mode. This is data validation code which i need, I have very similar code running in the userform sub, so I am assuming it has something to with being a called procedure running from a module? Any help would be greatly appreciated, thanks

Jennifer