Refer to Tab Control list box in another form

melbushman

New member
Local time
Today, 05:45
Joined
Aug 23, 2011
Messages
8
Hello!

I am struggling with an Access 2007 database I inherited. The problem is regarding tab controls. I would like to refer to a value in a list box within a tab and use that value to populate a text box in a form.

I have a tab control called "TabCtl4" and the data I want to retrieve is on "page5", from a list called "lstContracts". I want to populate the ID [Russell Contract ID] into a text box on a form [frmIndexAdd]. This is what I have unsuccessfully come up with:


=[frmMDSMain].[Controls]![TabCtl4].[page5].[lstContacts].[Russell Contract ID]

Is there a way to pass a value from a list box on a tab to a text box on a form?

Thank you for reading my post! Any help is greatly appreciated!
 
Basics here:

http://www.mvps.org/access/forms/frm0031.htm

The tab control is not a part of the reference, so you'd need to drop the tab and page bits from your effort. Also, the part after the listbox reference wouldn't work. If you're trying to get a particular field from the listbox, you'd refer to its column:

...lstContacts.Column(x)

where x was the number of the column containing the desired data, starting with 0.
 
Thank you for your reply! I'll give it a try! Thanks again!
 
No problem, and welcome to the site! Post back if you get stuck.
 
Thank you for the welcome!

I am stuck again... I dropped the tab and page bits and this is what I have come up with:

=[frmMDSMain].[Controls]![lstContacts].[Column](0)

Should I be referring to the tab somewhere in this statement?
 
No, the tab is never part of the reference. Try

=Forms!frmMDSMain.lstContacts.Column(0)
 

Users who are viewing this thread

Back
Top Bottom