ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close dialog box (https://www.excelbanter.com/excel-programming/306195-close-dialog-box.html)

Web_Builder

Close dialog box
 
I have one dialog box with several options on it. After you fill in the
required information you hit a "Continue" button, which takes you to another
dialog box. Everything works great except the first dialog box won't close
when the second one opens. Any suggestions on how to do this. Everything I
try doesn't work!
Thanks

patrick molloy

Close dialog box
 
without your code...

when the Continue button is clicked on, the code should
show the next form modeless, and the following code
should be the unload method...

userform1 has the button. the button, btnContinue will
show the next form, userform2...

Private Sub btnContinue_Click()
Me.Hide
UserForm2.Show vbModeless
Unload Me
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have one dialog box with several options on it. After

you fill in the
required information you hit a "Continue" button, which

takes you to another
dialog box. Everything works great except the first

dialog box won't close
when the second one opens. Any suggestions on how to do

this. Everything I
try doesn't work!
Thanks
.


Web_Builder[_2_]

Close dialog box
 
I am not using a userform (what is the advantage of doing so?) I have simply
inserted a dialog box and customized it (which has been working very well for
me so far). So from one dialog box I want to call another and close the first
one when you hit the "continue" button I have created. Here is the code for
my "continue" button.

Sub Button2_Click()

'SOLD TO
'Builder Name
Sheets("Email page").Cells(3, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 8").Text
'Builder Telephone
Sheets("Email page").Cells(4, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 9").Text
'Builder Fax
Sheets("Email page").Cells(5, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 10").Text
'Builder E-mail
Sheets("Email page").Cells(6, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 11").Text

'SHIP TO
'Street
Sheets("Email page").Cells(3, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 16").Text
'City
Sheets("Email page").Cells(4, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 19").Text
'State
Sheets("Email page").Cells(5, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 21").Text
'Zip
Sheets("Email page").Cells(5, 8).Value =
DialogSheets("Info").EditBoxes("Edit Box 23").Text
'Telephone
Sheets("Email page").Cells(6, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 25").Text


'Close Info
DialogSheets("Info").Hide
Unload DialogSheets("Info")

'Call Choice 1
DialogSheets("Choice 1").Show


End Sub

I can not get the first dialog box to close if I call the second.

"Patrick Molloy" wrote:

without your code...

when the Continue button is clicked on, the code should
show the next form modeless, and the following code
should be the unload method...

userform1 has the button. the button, btnContinue will
show the next form, userform2...

Private Sub btnContinue_Click()
Me.Hide
UserForm2.Show vbModeless
Unload Me
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have one dialog box with several options on it. After

you fill in the
required information you hit a "Continue" button, which

takes you to another
dialog box. Everything works great except the first

dialog box won't close
when the second one opens. Any suggestions on how to do

this. Everything I
try doesn't work!
Thanks
.



Tom Ogilvy

Close dialog box
 
try calling another macro with Ontime - the other macro shows the dialog

Sub Button2_Click()

'SOLD TO
'Builder Name
Sheets("Email page").Cells(3, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 8").Text
'Builder Telephone
Sheets("Email page").Cells(4, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 9").Text
'Builder Fax
Sheets("Email page").Cells(5, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 10").Text
'Builder E-mail
Sheets("Email page").Cells(6, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 11").Text

'SHIP TO
'Street
Sheets("Email page").Cells(3, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 16").Text
'City
Sheets("Email page").Cells(4, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 19").Text
'State
Sheets("Email page").Cells(5, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 21").Text
'Zip
Sheets("Email page").Cells(5, 8).Value =
DialogSheets("Info").EditBoxes("Edit Box 23").Text
'Telephone
Sheets("Email page").Cells(6, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 25").Text


'Close Info
DialogSheets("Info").Hide
Unload DialogSheets("Info")

'Call Choice 1
'DialogSheets("Choice 1").Show
Application.OnTime now, "ShowChoice"

End Sub

Private Sub ShowChoice()
DialogSheets("Choice 1").Show
End Sub

--
Regards,
Tom Ogilvy


"Web_Builder" wrote in message
...
I am not using a userform (what is the advantage of doing so?) I have

simply
inserted a dialog box and customized it (which has been working very well

for
me so far). So from one dialog box I want to call another and close the

first
one when you hit the "continue" button I have created. Here is the code

for
my "continue" button.

Sub Button2_Click()

'SOLD TO
'Builder Name
Sheets("Email page").Cells(3, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 8").Text
'Builder Telephone
Sheets("Email page").Cells(4, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 9").Text
'Builder Fax
Sheets("Email page").Cells(5, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 10").Text
'Builder E-mail
Sheets("Email page").Cells(6, 2).Value =
DialogSheets("Info").EditBoxes("Edit Box 11").Text

'SHIP TO
'Street
Sheets("Email page").Cells(3, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 16").Text
'City
Sheets("Email page").Cells(4, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 19").Text
'State
Sheets("Email page").Cells(5, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 21").Text
'Zip
Sheets("Email page").Cells(5, 8).Value =
DialogSheets("Info").EditBoxes("Edit Box 23").Text
'Telephone
Sheets("Email page").Cells(6, 6).Value =
DialogSheets("Info").EditBoxes("Edit Box 25").Text


'Close Info
DialogSheets("Info").Hide
Unload DialogSheets("Info")

'Call Choice 1
DialogSheets("Choice 1").Show


End Sub

I can not get the first dialog box to close if I call the second.

"Patrick Molloy" wrote:

without your code...

when the Continue button is clicked on, the code should
show the next form modeless, and the following code
should be the unload method...

userform1 has the button. the button, btnContinue will
show the next form, userform2...

Private Sub btnContinue_Click()
Me.Hide
UserForm2.Show vbModeless
Unload Me
End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have one dialog box with several options on it. After

you fill in the
required information you hit a "Continue" button, which

takes you to another
dialog box. Everything works great except the first

dialog box won't close
when the second one opens. Any suggestions on how to do

this. Everything I
try doesn't work!
Thanks
.






All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com