Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box (Access 2000)

    I have a combo box based on one table, and it chooses from the field clientid. I need a combo box that combines 2 fields from 2 different tables : the field customerid from the table Customers and the field Clientid from the table TblClients. They should both be listed alphabetically n the combo box. Can you help me ? I am apllaying the database

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

    Re: Combo box (Access 2000)

    As it is now, this doesn't make sense: your combo box is bound to a field ClientID, but the form as a whole is not bound to a table or query.

    You could create a union query that combines records from Customers and TblClients, but since CustomerID and ClientID have the same values (1, 2 and 3), the union query would not be uniquely identifiable. If the user selects an ID of 2, it could be 2 from Customers or 2 from TblClients.

    So you'll have to rethink what you want to do.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo box (Access 2000)

    You can change the Row Source of the combo so that it is a query that uses both tables, then include fields from either table.

    But, unless you establish some connection between customers and clients I don't know what it would mean listing them both.
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    Sep 2006
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box (Access 2000)

    Thank you.My example was not right. I have mislead you, please apologize me. Actually the names of the customers and the clients should be different.They cannot be the same.So union query is all right but it is difficult for me do do i.Not only that, but the source of the form which is query1 is not right,i cannot build properly the query itself. If you want to issure an offer to either a customer or a client, peovidied that the names should not coincide, what method woud you use ?
    What i want to achieve is to issue an offer from a list comprising both our customers and our clients.Up to now we were able to issue an offer only for a clent.

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

    Re: Combo box (Access 2000)

    It isn't going to work this way. Instead of having separate tables for customers and clients, you should have only one table, with an extra field (for example a Yes/No field) to indocate whether the record is for a customer. That way, you won't need a union query.

    See attached version.

Posting Permissions

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