MSACCESS Combo Box multiple bound cols?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

tomlock2

Thread Starter
Joined
Nov 20, 2011
Messages
49
I have a main form with a combo box called APPTID. Also on this form are 2 subforms which have a Master/Child Link to APPTID. They both work fine as and change the data they display when I select a new value in the combo box.

However now I wish to link these subforms to 2 of the cols in the selected combo box row. Both APPTID and PERSON_ID. Any ideas how I might best do this?
 

OBP

Joined
Mar 8, 2005
Messages
19,896
You need the Person_ID on the mainform, that will allow you to add it to ther master/child links.
 

tomlock2

Thread Starter
Joined
Nov 20, 2011
Messages
49
How do I get the Person_ID on the mainform? Since it is one of data fields on the row selected from the ComboBox I am uncertain how to access it.
 

OBP

Joined
Mar 8, 2005
Messages
19,896
The only logical way to have the ID on the mainform is to base the mainform on the same query as the Combo box and use the combo to "Find" the required record.
 

tomlock2

Thread Starter
Joined
Nov 20, 2011
Messages
49
I didn't understand your last response. But how about this ----

Create a new text box on the Main form called Person_ID and set it's control source property to ME!APPTID.COLUMN(1)? APPTID is the Name of the Combo Box control.

The bound column setting in the combo box APPTID is set to 1. That's the first column in drop down list and it is the APPTID field of the selected row. The second column in the drop down list is the Person_ID. It's weird that they number the BOUND Cols starting at 1 and the Column references of the rows starting at 0 but that's what I read was correct.

By the way -- I thought that might work but for some reason doesn't. Did I incorrectly reference Combo box in the text box Control Source?
 

OBP

Joined
Mar 8, 2005
Messages
19,896
I don't think you can set a Master/Child link using a field like that,
As to your question, does the PersonID appear in the field called Person_ID.
My suggestion involves the Combo box's Row Source, a combo box uses either an SQL query or an actual query. You can use the same Query as the record source of your mainform, unless it already has a record source.
If it already has a record source then why isn't the Person_ID already on it?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top