Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Goto Command in Code

Excel 2k


I have two forms (Form1 & form2). Form 1 has code within
it that checks various cells in a worksheet. I have some
validation within where if the cell value < "" then Form2
pops up and asks whether the user is sure that they want
to continue and update the worksheet. If they click on
yes, the worksheet appears. If they choose "No", I want
the code to resume in Form1. Although I knows it not good
practice to use the Goto command, its the only solution I
could think off but I can't get it to work. Any help
avaliable??
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Goto Command in Code

Jim,

you could try this...

Have the update code in Form1, and the main control logic there, so that it
is always the one that is really in control.

on Form2, have an invisible label, called lblCancel.

Code structure then looks like this

Sub Main
Form1.Show
End Sub

In Form1 code
cmdDoSomething_Click
Me.Hide
Form2.Show
If Form2.lblCancel.Caption = "TRUE" then
Unload Form2
Else
'do something
Unload Form2
End If
End Sub

In Form2 code
cmdCancel_Click
lblCancel.Caption = "TRUE"
me.hide
End Sub

cmdOK_Click
me.hide
End Sub

Robin Hammond
www.enhanceddatasystems.com

"JimPNicholls" wrote in message
...
Excel 2k


I have two forms (Form1 & form2). Form 1 has code within
it that checks various cells in a worksheet. I have some
validation within where if the cell value < "" then Form2
pops up and asks whether the user is sure that they want
to continue and update the worksheet. If they click on
yes, the worksheet appears. If they choose "No", I want
the code to resume in Form1. Although I knows it not good
practice to use the Goto command, its the only solution I
could think off but I can't get it to work. Any help
avaliable??



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Goto Command in Code

put code behind form2 to open form1 and close form2
-----Original Message-----
Excel 2k


I have two forms (Form1 & form2). Form 1 has code within
it that checks various cells in a worksheet. I have some
validation within where if the cell value < "" then

Form2
pops up and asks whether the user is sure that they want
to continue and update the worksheet. If they click on
yes, the worksheet appears. If they choose "No", I want
the code to resume in Form1. Although I knows it not good
practice to use the Goto command, its the only solution I
could think off but I can't get it to work. Any help
avaliable??
.

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
command code ( GOTO command) in formula calan New Users to Excel 1 June 11th 09 09:44 AM
Goto code Bob Excel Discussion (Misc queries) 4 July 6th 06 05:44 PM
USING A GOTO COMMAND IN EXCEL gscar2005 Excel Worksheet Functions 1 February 9th 05 05:30 AM
search or goto command needed. mightymax Excel Programming 1 July 26th 04 03:42 AM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM


All times are GMT +1. The time now is 02:53 PM.

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"