Name of controls in multipage and how to adress controll

haseft

Active Member
Joined
Jun 10, 2014
Messages
321
hi,
I have one multipage with 3 tab/page.
each page have some controlls, textbox, listbox, combobox

have 2 questios.:
1)
in page1 i have a textbox with name "Textbox1".
in page2 i want a textbox with same name "Textbox1".
this is not working. i get error "name exist".

2)
how do I adress a specifc controll for ex. page2?
Code:
dim mytext as String
mytext = MultiPage1.Page2.TextBox1.Value
not working
help with this please.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You can't have controls with the same name on a form even if they are on separate pages.

Why not include the page the controls in some format when naming the controls?

If you want to refer to control on a multipage page via it's parent you can use this.
Code:
Dim myText As String

    Me.MultiPage1.Pages(0).Controls("TextBox1").Value
 
Upvote 0
Solution
You can't have controls with the same name on a form even if they are on separate pages.

Why not include the page the controls in some format when naming the controls?

If you want to refer to control on a multipage page via it's parent you can use this.
Code:
Dim myText As String

    Me.MultiPage1.Pages(0).Controls("TextBox1").Value
thanks Norie, it works (y) ?
 
Upvote 0

Forum statistics

Threads
1,215,528
Messages
6,125,342
Members
449,218
Latest member
Excel Master

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