Combo Box based on 2 columns

pikou

Registered User.
Local time
Today, 07:13
Joined
Jul 20, 2004
Messages
24
Hello everyone,
I have a combo box on a form tha displays information based on 2 columns from a table.What I want the combo to do is to allow the user to select the row he wants and for the field that is bound to the combo box to store the outcome of collumn1 + collumn2 (string values).
Is this at all possible and if so how can I do it cause I can't find a way.
Thanks for all your time and effort :)
 
If you have information in one table you should not have a "copy" of it in another table, just the PrimaryKey.

An example would be tblPostCodes (City, PostCode, State). On your form (linked to table tblCustomers) you would look up the City,PostCode,State in your combo box, select a City, the form would display Melburne Vic 3000 but the table (tblCustomers) would only record the primary key of the record.

If you need further clarification, either look at the Northwind db (that comes with access) or post back and I post you a sample db.
 
The problem is tha the combo box is based on a query from a table let's say Clients and on that query I take the fields (last_name,first_name,id) , concatenate the last_name and first_name so tha the user sees on the two column combo box (last_name & " " & first_name,id).I need the user to see on the combo box after selecting only the client concatenated name not the id but now that I have that working I can't link back to the Clients table and the form that is based on that using my combo box info.
I tried linking the Client's table id field with the combo box column(1) but I couldn't get that to work.
Any thoughts on this one ?
 
I don't understand what you mean by;

I can't link back to the Clients table and the form that is based on that using my combo box info.
however have a look at my sample, if gives you three examples of storing keys instead of duplicate information.

I did this in a hurry, however you should be able to get an idea how is should be done.

Any Questions Post Back.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom