Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default MsgBox execution sends program into design mode

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default MsgBox execution sends program into design mode

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Mode Oldjay Excel Discussion (Misc queries) 6 May 9th 08 12:31 AM
Design Mode - or something like it. C Brandt Excel Discussion (Misc queries) 1 August 13th 07 07:08 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 07:21 PM
Enter Excel Design Mode and Exit Design Mode Bill Lunney Excel Programming 0 August 4th 03 07:48 AM


All times are GMT +1. The time now is 04:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"