Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008
    Posts
    114

    Unanswered: Make a dependent combo based on another combo

    Hi,,,
    I have been messing with this most of the day. I downloaded an example db too, but it's confusing me.
    What I want to do is have the MedName combo-box only show those records that are determined by the Unbound combo-box at the top.

    The pic may help.
    THe Unbound combo-box at the top shows the clients full name.

    Code:
    SELECT [all_clients].FullName, [all_clients].ClientIsCurrent FROM all_clients WHERE ((([all_clients].ClientIsCurrent)=Yes)) ORDER BY [all_clients].FullName;
    Then the MedName combobox is like this:
    Code:
    SELECT tbl_Medication.MedID, tbl_Medication.MedName, tbl_Medication.Dose, tbl_Medication.ClientID FROM tbl_Medication INNER JOIN tbl_Client ON tbl_Medication.ClientID=tbl_Client.ClientID;
    Hoping someone can help me out.

    Tracy
    Attached Thumbnails Attached Thumbnails combo.bmp  

  2. #2
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by Gwyar View Post
    Hi,,,
    I have been messing with this most of the day. I downloaded an example db too, but it's confusing me.
    What I want to do is have the MedName combo-box only show those records that are determined by the Unbound combo-box at the top.

    The pic may help.
    THe Unbound combo-box at the top shows the clients full name.

    Code:
    SELECT [all_clients].FullName, [all_clients].ClientIsCurrent FROM all_clients WHERE ((([all_clients].ClientIsCurrent)=Yes)) ORDER BY [all_clients].FullName;
    Then the MedName combobox is like this:
    Code:
    SELECT tbl_Medication.MedID, tbl_Medication.MedName, tbl_Medication.Dose, tbl_Medication.ClientID FROM tbl_Medication INNER JOIN tbl_Client ON tbl_Medication.ClientID=tbl_Client.ClientID;
    Hoping someone can help me out.

    Tracy
    Tracy,

    Unfortunately the picture does not show how the form works (VBA cpode and.or macros)

    The row source for the MedName combobox will need to use a Where clause that references the unbound combo box.

    Something like this:
    Code:
    SELECT tbl_Medication.MedID, tbl_Medication.MedName, tbl_Medication.Dose, tbl_Medication.ClientID FROM tbl_Medication Where  tbl_Medication.ClientID= Forms!YourFormName.cboClientID;
    **The above is Air Code - Untested ***


    You will need to substitute your object names for Forms!YourFormName.cboClientID
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •