Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Main User form closes when I double Click list box to update 2nd f

The code below was got from this site and it allows me to load user form 2
when I double click list box
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim varcounter As Integer
Load UserForm2
UserForm2.TextBox1 = Me.ListBox1.Value
UserForm2.Show
If UserForm2.bUpdate Then
'Update
End If
Unload UserForm2

...... However, on clicking ok(update) or cancel button on the user form 2,
the content of the list box and on all the controls on the main form
disappears. HELP!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Main User form closes when I double Click list box to update 2nd f

add

me.Repaint

after userform2.Show




"Yomi" wrote:

The code below was got from this site and it allows me to load user form 2
when I double click list box
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim varcounter As Integer
Load UserForm2
UserForm2.TextBox1 = Me.ListBox1.Value
UserForm2.Show
If UserForm2.bUpdate Then
'Update
End If
Unload UserForm2

..... However, on clicking ok(update) or cancel button on the user form 2,
the content of the list box and on all the controls on the main form
disappears. HELP!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Main User form closes when I double Click list box to update 2nd f

Thank you. It worked. However I had to remove the controls.value="" from the
userform activate.

"Yomi" wrote:

The code below was got from this site and it allows me to load user form 2
when I double click list box
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim varcounter As Integer
Load UserForm2
UserForm2.TextBox1 = Me.ListBox1.Value
UserForm2.Show
If UserForm2.bUpdate Then
'Update
End If
Unload UserForm2

..... However, on clicking ok(update) or cancel button on the user form 2,
the content of the list box and on all the controls on the main form
disappears. HELP!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Main User form closes when I double Click list box to update 2

I'm happy that it worked, though i don't understand your comment. the code
piece you quote isn't in th ecdoe that you gave us.

"Yomi" wrote:

Thank you. It worked. However I had to remove the controls.value="" from the
userform activate.

"Yomi" wrote:

The code below was got from this site and it allows me to load user form 2
when I double click list box
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim varcounter As Integer
Load UserForm2
UserForm2.TextBox1 = Me.ListBox1.Value
UserForm2.Show
If UserForm2.bUpdate Then
'Update
End If
Unload UserForm2

..... However, on clicking ok(update) or cancel button on the user form 2,
the content of the list box and on all the controls on the main form
disappears. HELP!

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
Must I Always Click Twice to Return to My Document from a User Form susiecc via OfficeKB.com Excel Programming 1 April 10th 07 07:18 PM
User form closes after opening another one -- Problem with "Unload Me"? [email protected] Excel Programming 2 January 8th 07 05:52 AM
sum doesn't update total without double-click of cell David E. Gross Excel Discussion (Misc queries) 1 February 5th 05 12:44 AM
2nd Form deselects list box items on main form RandyDtg1 Excel Programming 3 September 5th 04 09:32 PM
Creating a User Form to update a list Gary Hall Excel Programming 1 January 4th 04 03:02 PM


All times are GMT +1. The time now is 07:20 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"