Navigation between 2 Userforms

rohanmalhotra

New Member
Joined
May 4, 2010
Messages
29
Hi all

Need urgent help. I have prepared 2 userforms. First Userform has a button to open the second userform, however, as soon as i click on that button, the data from first userform dissappears.

Also, i have 2 common fields in both userforms but not sure if i can get the value in second userform from the first one.

i think this is too confusing.

Many Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi

Below is the code :

HTML:
Private Sub CommandButton1_Click()
    
    Me.Hide
    ApprovalLog.Show
    
End Sub

HTML:
Private Sub UserForm_Activate()
Me.txtDateOne.Value = QualityLog.txtDate.Value
Me.txtWitemOne.Value = QualityLog.txtWorkitem
End Sub
 
Upvote 0
Try changing your activate event to initialize event.
Rich (BB code):
Private Sub UserForm_Initialize()
    Me.txtDateOne.Value = QualityLog.txtDate.Value
    Me.txtWitemOne.Value = QualityLog.txtWorkitem
End Sub

and I'm not too sure what you mean by the first data disappearing?
As long as the userform is not unloaded, it should be okay. But just in case you could also fix the first part of your code to explicitly load the next userform.

Rich (BB code):
Private Sub CommandButton1_Click()
    
    Me.Hide
    Load ApprovalLog
    ApprovalLog.Show
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,348
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top