Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Aug 2005
    Location
    Novi Sad, Serbia and Montenegro (Yugoslavia)
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo boxes (Access 2003)

    How to choose a field (with ID suffix), that is related to two other fields (e.g. first name and last name) to make a combo box based on these three fields? And, in general, how to choose a field that contains unique data? Thanks

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

    Re: Combo boxes (Access 2003)

    I'm not sure I understand what you mean.

    You can create a query that displays the data the way you want, perhaps the ID in the first column and last and first name concatenated in the second column. If you set the Unique Values property of the query to Yes, the query will suppress duplicates. You can use the query as Row Source of the combo box. Set the Column Count property of the combo box to the number of columns in the query. Set the Column Widths the way you want; you can hide a column by setting its width to 0.

    If this is not what you intended, please try to explain in more detail what you meant.

  3. #3
    Star Lounger
    Join Date
    Aug 2005
    Location
    Novi Sad, Serbia and Montenegro (Yugoslavia)
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo boxes (Access 2003)

    OK. I will explain. I made a table Contacts, and wrote 3 records. And I made a form Contacts based on this table. How to make a combo box that contains columns ID, FirstName and LastName, and, how to set up field "ID" as a field that contains unique data? I want next: when I click on combo box ContactID, I want to fill with exact value of ID fields FirstName and LastName that contain data related with value specified in field ID(for example, when I choose ID with value 3, I want to fill fields FirstName and LastName with values "X" and "Y"). and, can I set up a table as a source of data, and how?

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

    Re: Combo boxes (Access 2003)

    Do you want the combo box to search for the record corresponding to the item selected in the list? If so, the easiest way to make one is to turn on the Control Wizards button on the Toolbox (it's the second button, with the magic wand and stars). If you then put a combo box on the form, the Combo Box Wizard will start, offering 3 options. Select the 3rd one, to search for a record, then click Next. You can specify the way the combo box works in the next steps, they should explain themselves.

    If you want the combo box to select a contact, that doesn't make sense in the form based on the Contacts table. You could use that in a form based on another table that has a Contact field.

Posting Permissions

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