Not In List

  • Thread starter Thread starter ADonMS
  • Start date Start date
A

ADonMS

Hi.
I have a customers table and employees tables. My customers form includes
all names from customers table, however, I would like to add new names from
the employees table to my customers form. Can someone tell me how this can
be done?
Thanks.
 
Thank you so much for the example and notinlistcodes.
This is exactly what I need. One thing however,(or maybe two). Can I use
this code on a subform? Also, when the user is directed to the customer form
to add new customer, I would like this data to come from an existing query.
So when the customer puts in the name, the remainding fields are
auto-updated. Is this possible?
Thanks, again.
 
ADonMS said:
Thank you so much for the example and notinlistcodes.
This is exactly what I need. One thing however,(or maybe two). Can I use
this code on a subform?

I've never tried it, but I expect that it should work. Make sure that any
form reference that you use reference the subform.
Also, when the user is directed to the customer form
to add new customer, I would like this data to come from an existing
query.
So when the customer puts in the name, the remainding fields are
auto-updated. Is this possible?

If the data doesn't exist, how can other fields be filled in? If it does
exist, you do not need a NotInList routine.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Actually, the data does exists in a different table. The Customers are
Employees. I imported employee information from Excel file into database.
When an employee is assigned to a report, they become the "customer". I want
to use the Employee table for "lookup" value. Not sure of the best way to set
this up.
 
You don't need code at all. The employees are already in the Employee table.
All you need to store is the EmployeedID which should also be in the same
table, so bind the combo to the EmployeeID field and use a RowSourceType of
Table/Query and the Employee table as the RowSource. Or better yet use a SQL
statement on the Employee table like:

Select EmployeeID, EmployeeName From tblEmployee
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top