Results 1 to 6 of 6
  1. #1
    Trickle is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3

    Combo box to display information from two tables

    Hi All

    I've got a combo box on a Client Support Plan form to display information from a client Home Assessment table, eg

    Row Source:SELECT [HomeAssessment].[ClientNumber], [HomeAssessment].[ClientLastName], [HomeAssessment].[ClientFirstName], [HomeAssessment].[StaffMember], [HomeAssessment].[PersonalGoal1], [HomeAssessment].[PersonalGoal2], [HomeAssessment].[PersonalGoal3], [HomeAssessment].[PersonalGoal4], [HomeAssessment].[PersonalGoal5], [HomeAssessment].[PersonalGoal6] FROM HomeAssessment ORDER BY [PatientLastName];

    On Change Code:
    Private Sub Combo356_Change()
    Me.ClientFirstName = Me.Combo356.Column(2)
    Me.ClientLastName = Me.Combo356.Column(1)
    Me.PersonalGoal1 = Me.Combo356.Column(4)
    Me.PersonalGoal2 = Me.Combo356.Column(5)
    Me.PersonalGoal3 = Me.Combo356.Column(6)
    Me.PersonalGoal4 = Me.Combo356.Column(7)


    Me.PersonalGoal5 = Me.Combo356.Column(8)
    Me.PersonalGoal6 = Me.Combo356.Column(9)
    Me.StaffMember = Me.Combo356.Column(3)
    [Visit Requirement].SetFocus
    End Sub


    etc....

    This works fine but I would also like the same combo box to display the client's address information, which is stored in a separate Referrals table. Is this possible?

    Many thanks in advance for all and any help.

    Trickle

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    The combo is only meant to show 1 item to pick, the client, or a State, etc.
    if you are showing every personal goal and the address for every client , then you are doing something wrong.

    You want a 'client' combo box, to show only client names, addr

    then after that is chosen, you want a 'goal' combo, to pick ONLY the person in the cboClient box's goals
    select goals where [personID] = " & cboClient





  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Sure; add the other table to the row source query, and join on the appropriate field(s), presumably client number.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Trickle is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3
    Many thanks for your replies. I am only getting the personal goals for a single client, which is what I want. I'll have a go at adding the Referral table to the row source query.

  5. #5
    Trickle is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    3
    This worked perfectly - many thanks

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-04-2015, 07:21 PM
  2. Replies: 5
    Last Post: 11-19-2014, 06:30 PM
  3. Replies: 7
    Last Post: 05-21-2014, 02:55 PM
  4. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  5. Replies: 8
    Last Post: 10-30-2013, 11:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums