Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Hi,
have a userform called 'startformulier'. on 'startformulier' i have a button called 'disclaimer'. When the button is clicked the following code is executed: Private Sub but_disclaimer_Click() disclaimer.Show End Sub on the userform (disclaimer) that appears i have a button 'OK' to close this userform again. the code for the 'OK' button is: Private Sub but_ok_Click() unload disclaimer End sub The problem is that when the OK button on the disclaimer form is clicked, the form is closed but also the main form 'startformulier is closed ! Can anybody help me close just the 'disclaimer' form please ? thanks, Pierre P.S. i now use Private Sub but_ok_Click() disclaimer.hide End sub but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Wat gebeurt er als je in plaats van Unload disclaimer Unload Me gebruikt?
-- ~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,~*""*~.,,.~* ""*~.,,.~*""*~ "Pierre via OfficeKB.com" <u13950@uwe schreef in bericht news:5638094643874@uwe... Hi, have a userform called 'startformulier'. on 'startformulier' i have a button called 'disclaimer'. When the button is clicked the following code is executed: Private Sub but_disclaimer_Click() disclaimer.Show End Sub on the userform (disclaimer) that appears i have a button 'OK' to close this userform again. the code for the 'OK' button is: Private Sub but_ok_Click() unload disclaimer End sub The problem is that when the OK button on the disclaimer form is clicked, the form is closed but also the main form 'startformulier is closed ! Can anybody help me close just the 'disclaimer' form please ? thanks, Pierre P.S. i now use Private Sub but_ok_Click() disclaimer.hide End sub but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Try showing the first userform as modeless:
UserForm("startformulier").Show False '(modeless) Mike F "Pierre via OfficeKB.com" <u13950@uwe wrote in message news:5638094643874@uwe... Hi, have a userform called 'startformulier'. on 'startformulier' i have a button called 'disclaimer'. When the button is clicked the following code is executed: Private Sub but_disclaimer_Click() disclaimer.Show End Sub on the userform (disclaimer) that appears i have a button 'OK' to close this userform again. the code for the 'OK' button is: Private Sub but_ok_Click() unload disclaimer End sub The problem is that when the OK button on the disclaimer form is clicked, the form is closed but also the main form 'startformulier is closed ! Can anybody help me close just the 'disclaimer' form please ? thanks, Pierre P.S. i now use Private Sub but_ok_Click() disclaimer.hide End sub but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Hi Bart,
I'm not sure why clicking the OK to unload your disclaimer for causes your main form to unload. However if user clicks the little "x" it would. Try something like in your 'startformulier' form Private Sub but_disclaimer_Click() ' me.hide disclaimer.Show ' me.show End Sub in your discalimer form Private Sub but_ok_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim Ans As Long If CloseMode = vbFormControlMenu Then but_ok_Click End If End Sub You might also want to set the Cancel property of but_ok_Click to True. Regards, Peter T "Pierre via OfficeKB.com" <u13950@uwe wrote in message news:5638094643874@uwe... Hi, have a userform called 'startformulier'. on 'startformulier' i have a button called 'disclaimer'. When the button is clicked the following code is executed: Private Sub but_disclaimer_Click() disclaimer.Show End Sub on the userform (disclaimer) that appears i have a button 'OK' to close this userform again. the code for the 'OK' button is: Private Sub but_ok_Click() unload disclaimer End sub The problem is that when the OK button on the disclaimer form is clicked, the form is closed but also the main form 'startformulier is closed ! Can anybody help me close just the 'disclaimer' form please ? thanks, Pierre P.S. i now use Private Sub but_ok_Click() disclaimer.hide End sub but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
hoi mooncrawler,
als ik Unload Me gebruik wordt ook het 'startformulier' gesloten...helpt dus niet. enig idee? Pierre mooncrawler wrote: Wat gebeurt er als je in plaats van Unload disclaimer Unload Me gebruikt? Hi, [quoted text clipped - 31 lines] but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Hi Mike,
I can't show the form as modeless because i do not want the user to be able to acces the sheet behind the 'startormulier' form... any other ideas? Pierre Mike Fogleman wrote: Try showing the first userform as modeless: UserForm("startformulier").Show False '(modeless) Mike F Hi, [quoted text clipped - 31 lines] but i feel this is not the right way to do this. -- Message posted via http://www.officekb.com |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Hi Peter,
Your code works fine but now the main form ('startformulier') disappers completely when the 'disclaimer' form is shown. Can i have the 'disclaimer' form shown and close on top of the 'startformulier' form ? thanks for your input ! Pierre Peter T wrote: Hi Bart, I'm not sure why clicking the OK to unload your disclaimer for causes your main form to unload. However if user clicks the little "x" it would. Try something like in your 'startformulier' form Private Sub but_disclaimer_Click() ' me.hide disclaimer.Show ' me.show End Sub in your discalimer form Private Sub but_ok_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim Ans As Long If CloseMode = vbFormControlMenu Then but_ok_Click End If End Sub You might also want to set the Cancel property of but_ok_Click to True. Regards, Peter T Hi, [quoted text clipped - 28 lines] but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
Hi Pierre,
Sorry for confusing your name with someone else last time. Your main form ('startformulier') might disappear (ie get placed under) depending on respective sizes & positions of that & your 'disclaimer' form. You can of course change either or both positions before showing the disclaimer form. Apart from that I don't quite follow what you want to do differently. Regards, Peter T "Pierre via OfficeKB.com" <u13950@uwe wrote in message news:56447f621829e@uwe... Hi Peter, Your code works fine but now the main form ('startformulier') disappers completely when the 'disclaimer' form is shown. Can i have the 'disclaimer' form shown and close on top of the 'startformulier' form ? thanks for your input ! Pierre Peter T wrote: Hi Bart, I'm not sure why clicking the OK to unload your disclaimer for causes your main form to unload. However if user clicks the little "x" it would. Try something like in your 'startformulier' form Private Sub but_disclaimer_Click() ' me.hide disclaimer.Show ' me.show End Sub in your discalimer form Private Sub but_ok_Click() Unload Me End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim Ans As Long If CloseMode = vbFormControlMenu Then but_ok_Click End If End Sub You might also want to set the Cancel property of but_ok_Click to True. Regards, Peter T Hi, [quoted text clipped - 28 lines] but i feel this is not the right way to do this. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200510/1 |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem userform disappears
PS,
Remove "Dim Ans As Long" in the from code in my previous suggestion: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim Ans As Long If CloseMode = vbFormControlMenu Then but_ok_Click End If End Sub Peter T |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform problem? | Excel Discussion (Misc queries) | |||
Userform from a Userform Problem | Excel Programming | |||
SOme problem on VBA Userform | Excel Programming | |||
Userform disappears when you try to initialize from a command button | Excel Programming | |||
SaveCopyAs - Userform disappears | Excel Programming |