R
Roxanne
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 display (in 2 additional boxes on the form) the
word "current" and the date "1/1/2006" any time someone picks customer ABC
from the drop down list for customer when entering a trouble ticket?
The technicians do not know the maintenance status and expiration of the
customers and I need those two columns from the Customer table to populate
into seperate boxes under the drop down list for Customers. This way, any
time they enter a trouble ticket and selecting a customer, those two boxes
will populate the maintenance status of the customer so the tech knows.
I had one reply before (listed below) and when I followed those coding
instructions, it showed all 3 columns (company name, maint, expiration) all
in the drop down list for the Customer, but when you selected a certain
customer, the only thing visible was the company name.
I just want to get the maintenance and expiration to populate into 2 other
boxes when a certain company is selected from the drop down menu. Is this
possible and if so, how do I accomplish it?
ORIGINAL ANSWER:
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]
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 display (in 2 additional boxes on the form) the
word "current" and the date "1/1/2006" any time someone picks customer ABC
from the drop down list for customer when entering a trouble ticket?
The technicians do not know the maintenance status and expiration of the
customers and I need those two columns from the Customer table to populate
into seperate boxes under the drop down list for Customers. This way, any
time they enter a trouble ticket and selecting a customer, those two boxes
will populate the maintenance status of the customer so the tech knows.
I had one reply before (listed below) and when I followed those coding
instructions, it showed all 3 columns (company name, maint, expiration) all
in the drop down list for the Customer, but when you selected a certain
customer, the only thing visible was the company name.
I just want to get the maintenance and expiration to populate into 2 other
boxes when a certain company is selected from the drop down menu. Is this
possible and if so, how do I accomplish it?
ORIGINAL ANSWER:
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]