How to use the name of one Userform which is received in another Userform as a variable?
P. Michael

Recommended Answers

All 5 Replies

very vague question, perhaps some code or a further explanation of what you mean.


Good Luck

frmPBar has one label lblScroller. While I am searching through Excel REcords in frmFriends, I want the lblScroller to increment like a progress bar and tell the user that proceesing is being done. To do this in frmFriends I want to measure the width of lblScroller, which is in frmPBar. How to call in frmFriends, the control which is on frmPBar. Later on, I will call that label from frmKithAndKin and also from frmVIPs. Any suggestion, appreciated. I am new to VB.
-PMYK

Okay, to get or set controls in other forms it is as simple as...

'we are in form1 and we want the width of label1 in form2
MyVariable = Form2.Label1.Width

or to set...

'we are in form1 and we want to set the width of label1 in form2
Form2.Label1.Width = MyVariable

Good Luck

Mr. vb5prgrmr !
Thank you very much. It works fine. You have solved my problem. Probably some others also may be benefitted. Thanks for the good service.
-PM

Your welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.