Viewing Data in Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database for event ticket management and have a form set up for
ticket order entry. I have a combo box set up for the field Customer Number.
It shows the FirstName, LastName, Address, and City fields of the customer in
the drop down box. When you hav selected the appropriate customer you can
then only see the FirstName of the customer. Is there a way to show all of
these fields after you have selected the correct customer? Thank you. I am a
beginner so I am sorry if I don't have enough details in this question.
 
kmacpher,
I'm not sure how you have the combo (ex. name cboCustID) set up, but you can
"calculate" the Name and Address columns in an unbound text control.
Add an unbound text control to the form with a ControlSource of... (use your correct
col nos)
= cboCustID.Column(1) & " " & cboCustID.Column(2) & " " & cboCustID/Column(3)... etc...
for all the address realated columns.
That will "display" the related address info.

More visually appealing would be to display the First/Last Name in one unbound field
Address in another...
CSZ in another...
Then the Name and address info derived from the combo would "read" just like an normal
address, rather than one long line.
 
Hello Al,

Thank you for your reply. I've tried what you suggested but am not having
any luck the field just comes up with #Name? in the box. These are the stepes
I've taken.

1. Put a new unbound text field on my form.
2. Gone into the properties for the text field and entered this into the
Control Source field..... =Customer Number.Column(1) & " " & Customer
Number.Column(2) & " " & Customer Number.Column(3) & " " & Customer
Number.Column(4)
3. When I view my form it displays #Name? in my new unbound text box.

The Cutomer Number combo box is located in my Orders table and I created it
with a wizard. It pulls the row source from my Customers table.

If you have any idea of what I'm doing wrong I would greatly appreciate your
help!!

Thank you!!
 
Hello Al,

Thank you for your reply. I've tried what you suggested but am not having
any luck the field just comes up with #Name? in the box. These are the stepes
I've taken.

1. Put a new unbound text field on my form.
2. Gone into the properties for the text field and entered this into the
Control Source field..... =Customer Number.Column(1) & " " & Customer
Number.Column(2) & " " & Customer Number.Column(3) & " " & Customer
Number.Column(4)
3. When I view my form it displays #Name? in my new unbound text box.

The Cutomer Number combo box is located in my Orders table and I created it
with a wizard. It pulls the row source from my Customers table.

If you have any idea of what I'm doing wrong I would greatly appreciate your
help!!

Thank you!!

If you have blanks in your field or control names (which is not a very
good idea, IMO) then you MUST use square brackets to delimit the
names. I'd suggest changing the Name property of this combo box from
Customer Number to cboCustomerNumber and using

=cboCustomerNumber.Column(1)

and so on. Alternatively, use

=[Customer Number].Column(1)

Also note that most serious developers avoid using the Lookup Wizard
altogether. It is inefficient and can be very confusing, since it
conceals the actual contents of your table. By all means use combo
boxes on Forms - but you don't need to use them in the Table to do so!

John W. Vinson[MVP]
 
Is the combo box named "Customer Number"
If so, because you used spaces in your control name, you'll have to bracket that
name...
= [Customer Number].Column(1)
Try it with just that for now... when that works, you can add/concatenate the other
data.

It's always best not to use spaces in any object name. Ex. CustomerNumber or
Customer_Number.
Then the bracketing is not necsessary.
 

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

Back
Top