Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jenn wrote:
Hello, 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 The use of 'End' is a bit drastic. Try using 'Exit Sub' instead to see if that works better. -- Regards, Juan Pablo González |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Juan
Thanks, but I need the End for the If then statement. Also, I don't want to exit the sub at that particular spot. Any other ideas Jenn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Design Mode | Excel Discussion (Misc queries) | |||
Design Mode - or something like it. | Excel Discussion (Misc queries) | |||
Combo Box goes to edit mode even if design mode is in OFF position | Excel Discussion (Misc queries) | |||
Enter Excel Design Mode and Exit Design Mode | Excel Programming |