1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

MSACCESS Combo Box multiple bound cols?

Discussion in 'Business Applications' started by tomlock2, Nov 28, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. tomlock2

    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?
     
  2. OBP

    OBP

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

    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.
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    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.
     
  5. tomlock2

    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?
     
  6. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    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?
     
  7. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1028792

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice