Ryan Tatman
Ryan Tatman

Reputation: 11

Assistance with combo box using lookup table - MS Access

Basically what I have is a Customer Table which contains information about our customers. One of the fields in this table is Customer.CustomerTypeID.
I have a CustomerType Table as well that is basically a lookup table.
I want the CustomerType.CustomerTypeName field to populate my combo box, then when I go to save my record I want the CustomerType.CustomerTypeID for the CustomerType.CustomerTypeName I chose to be updated in the Customer.CustomerTypeID field.

Am I overcomplicating this? Should I just change it so I'm storing the CustomerName in the Customer table instead of the ID?

Thanks in advance.

Upvotes: 1

Views: 4292

Answers (1)

Fionnuala
Fionnuala

Reputation: 91316

No, store the ID.

Set your combo like so:

Row Source: SELECT CustomerTypeID, CustomerTypeName FROM CustomerType 
Control Source : CustomerTypeID
Bound Column : 1
Column Count : 2
Column widthes : 0, 2

The control source + bound column means that the data will be stored to a field called CustomerTypeID in the table the form is based on, the column widths means that the ID column is hidden and the description is displayed.

Upvotes: 5

Related Questions