Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 122
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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
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
Userform problem? law Excel Discussion (Misc queries) 0 December 3rd 07 07:54 PM
Userform from a Userform Problem Adrian Excel Programming 1 October 12th 05 04:57 PM
SOme problem on VBA Userform allissonlu Excel Programming 2 August 13th 04 01:34 AM
Userform disappears when you try to initialize from a command button RPIJG[_60_] Excel Programming 8 July 2nd 04 08:14 PM
SaveCopyAs - Userform disappears mohsinb[_2_] Excel Programming 1 November 6th 03 04:02 PM


All times are GMT +1. The time now is 01:47 AM.

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

About Us

"It's about Microsoft Excel"