R
Roxanne
My original question asked how to show other columns in a combo box. What I
really need to know is: Is there a way to get more than one column from a
table to show up on a form?
I have a form based off of a trouble ticket table. In the form, I have a
combo box that is currently allowing a person to select the customer from a
drop down list of customer names. The list to this box is coming from
another table within the database named "customers" and the customers table
is linked to the trouble ticket table by customer ID. The customers table
also contains maintenance status and expiration date columns. What I want to
know is if there is a way for the maintenance status and expiration date to
show up on the form when a certain customer is selected. For example - if
customer ABC is selected from the drop down list of customer and their
maintenance status is current and expiration date is 1/1/2006, is there a way
to get the maintenance status and expiration date to show up on the form any
time someone picks customer ABC in the drop down list for customer?
Thanks for anyone who can help with this. The text below is what my
original question was and I asked if there was a way for the additional two
columns to show up without having to manually type the info in for each
customer.
Good... just checking to be sure!
I'd recommend NEVER using combo boxes in Tables. I'm talking about a
combo box on the Form. See below...
The Row Source property of the combo box on the Form should be a Query
selecting the customer information. I'm suggesting that that query
include the two fields which you want to see. For example, the
RowSource property of the combo could be
SELECT CustomerID, CustomerName, Status, ExpirationDate
FROM Customers
ORDER BY CustomerName;
The Combo's ColumnCount property would be 4 to include all fields; its
ColumnWidths property would be
0;1.5;0;0
to display the customer name and hide all the other fields. The Bound
Column would be 1 so that the CustomerID is bound to your trouble
ticket's CustomerID field.
A Combo Box has a "Column" property which lets you extract information
other than the bound column's value from the combo. If your combo is
named cboCustomer, then simply look at the Control Source property of
the textbox on the form in which you wish to display the status, and
type in
=cboCustomer.Column(2)
This will automatically display the third (zero based, remember) field
from the combo - the status, using the example above.
John W. Vinson[MVP]
really need to know is: Is there a way to get more than one column from a
table to show up on a form?
I have a form based off of a trouble ticket table. In the form, I have a
combo box that is currently allowing a person to select the customer from a
drop down list of customer names. The list to this box is coming from
another table within the database named "customers" and the customers table
is linked to the trouble ticket table by customer ID. The customers table
also contains maintenance status and expiration date columns. What I want to
know is if there is a way for the maintenance status and expiration date to
show up on the form when a certain customer is selected. For example - if
customer ABC is selected from the drop down list of customer and their
maintenance status is current and expiration date is 1/1/2006, is there a way
to get the maintenance status and expiration date to show up on the form any
time someone picks customer ABC in the drop down list for customer?
Thanks for anyone who can help with this. The text below is what my
original question was and I asked if there was a way for the additional two
columns to show up without having to manually type the info in for each
customer.
John,
I have the maintenance status and expiration fields in the customer table -
I didn't put them in the trouble ticket table.
Good... just checking to be sure!
In the customer table, I have these two fields set as text boxes - should
they be set as something else? Also, you have "include the two fields in the
RowSource query for the customer combo box" and "use the columnwidths
property to set the width of these columns to zero." What does this mean
exactly? I don't have a combo box in my Customer table.
I'd recommend NEVER using combo boxes in Tables. I'm talking about a
combo box on the Form. See below...
Also, I understand adding two text boxes to my form, but don't understand
the (n) subscript of the field. I'm rather confused to the "combo's query"
you are referring to. Am I writing a query within the form?
The Row Source property of the combo box on the Form should be a Query
selecting the customer information. I'm suggesting that that query
include the two fields which you want to see. For example, the
RowSource property of the combo could be
SELECT CustomerID, CustomerName, Status, ExpirationDate
FROM Customers
ORDER BY CustomerName;
The Combo's ColumnCount property would be 4 to include all fields; its
ColumnWidths property would be
0;1.5;0;0
to display the customer name and hide all the other fields. The Bound
Column would be 1 so that the CustomerID is bound to your trouble
ticket's CustomerID field.
A Combo Box has a "Column" property which lets you extract information
other than the bound column's value from the combo. If your combo is
named cboCustomer, then simply look at the Control Source property of
the textbox on the form in which you wish to display the status, and
type in
=cboCustomer.Column(2)
This will automatically display the third (zero based, remember) field
from the combo - the status, using the example above.
John W. Vinson[MVP]