Drop down list

A

Alan

I am new to Access, want to practise and build a simple project.
I have a table called tblCustomer, and want to create form.
I put a dropdown list to select a customer, then put text control boxes onto
the form to display the fields of the record.
I will select the customer from the dropdown list and the corresponding
record details will be displayed on the other text boxes, can you tell me
how to do ?

Table: tblCustomer
Fields:
CustomerID
FirstName
LastName
Phone
DOB
Address
 
A

Alan

Thank you for your link.
However, if my table have 6 fields, I am not sure how to set the combo box
to display the name of the person only and then shows the other fields on
the text boxes.

If I set the Column count of the combo box to 6, it will display all six
fields, I can display all fields into the text boxes. BUT, I just want to
display the name in the combo box, ie I set the Column count to 1 but the
text boxes cannot show the other fields.
 
K

Ken Snell

You use the ColumnWidths property to tell the combo box which columns are to
be visible in the dropdown list. The combo box will display in itself (after
the dropdown list is gone) the first visible column in the list. So, if you
want the combo box to show the person's name, make that field the first
visible one.

For example, suppose the combo box's row source query contains the 6 fields
in this order:
PersonID, PersonName, PersonInfo1, PersonInfo2, PersonInfo3, PersonInfo4

And you want the PersonID to be the bound column and PersonName to be in the
combo box after selection and you want PersonInfo2 and PersonInfo3 only to
be displayed along with PersonName in the dropdown list -- set the
ColumnWidths property to this:
0"; 1.5"; 0"; 1"; 1"; 0"

Set the Bound Column to 1; set the Column Count to 6.

You can change the widths as you desire.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top