Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Boxes (2003)

    I have two fields -- a text DonorOrganization and an autonumber DonorID -- is there a way to combine them in a combo box for data entry to make the list searchable by both Organization and ID#?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Boxes (2003)

    You can display both in a combo box, for example by setting the Row Source to

    SELECT DonorID, DonorID & " - " & DonorOrganization FROM tblDonors

    or to the name of a query with the above SQL statement (using the actual table name)

    Set Column Count to 2 and Column Widths to 0";2" to hide the first column.

    But when you enter text in the text box part of the combo box, Access always tries to match on the first characters, not on any part of the text. So in this example, you won't be able to locate a donor by its DonorOrganization name. If you want to be able to do that, you need two separate combo boxes.

  3. #3
    New Lounger
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Boxes (2003)

    Thanks, I was afraid of that.

    Would there be a way to tie those two combo boxes together so that by selecting a DonorID in one, the other would automatically fill with the name of the corresponding Organization?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Boxes (2003)

    You can change the value of the other combo box in the After Update event of each combo box. For example:

    Private Sub cboDonorID_AfterUpdate()
    Me.cboDonorOrganization = Me.cboDonorID
    End Sub

    See the attached sample database (using a table from the Northwind database).

Posting Permissions

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