Tammy said:
Thanks & yikes - i'd have to do that for each of my 225 customers and
25 customer service reps? And it doesn't always have to be "Sally"
that represents K-Mart because Sally might be absent one day? Any
suggestions?
That's why I said there ought to be some way to determine by lookup who
is the rep for a particular customer. But you don't give us much
information about your form, your table structure, or the real-world
entities that your database is representing, and what this form is
supposed to do.
Probably you have a table of customers and a table of customer-service
reps. And probably you have a field in the Customers table that
identifies the normal customer-service rep for this customer (if there's
only one). So on the form, you can set up the customer combo, which I'm
calling "cboCustomer", so that it also holds the ID of the default
service rep for that customer. You'd do this by including an extra
column in the combo box, and setting the rowsource of the combo box to
pull that from the table. For example, you might have these tables:
Customers
--------------
CustomerID (autonumber, primary key)
CustomerName (text)
ServiceRepID (long integer, foreign key to ServiceReps)
(other fields ...)
ServiceReps
----------------
ServiceRepID (autonumber, primary key)
ServiceRepName (text) (or first, middle, last name fields)
(other fields ...)
Then on your form, cboCustomer would have these properties:
cboCustomer
-----------------
ColumnCount: 3
ColumnWidths: 0";1.5";0"
RowSource:
SELECT CustomerID, CustomerName, ServiceRepID
FROM Customers ORDER BY CustomerName;
The other combo, cboServiceRep, might have these properties:
cboServiceRep
--------------------
ColumnCount: 2
ColumnWidths: 0";1.5"
RowSource:
SELECT ServiceRepID, ServiceRepName
FROM ServiceReps ORDER BY ServiceRepName;
Now, with this setup, your code in the AfterUpdate procedure of
cboCustomer could look like this:
'----- start of example code -----
Private Sub cboCustomer_AfterUpdate()
Me!cboCustSvcRep = Me!cboCustomer.Column(2)
' Note that .Column(2) is the third column of the combo box.
End Sub
'----- end of example code -----