Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

listbox entries filtered by id selected in another field

Status
Not open for further replies.

pmsbony

IS-IT--Management
May 17, 2001
36
0
0
GB
I am sure this has been covered before but I can't get to the bottom of my problem:

I have a form showing some client details:

I have a table (clients) holding client names (client_name) and unique id (client_ID)

I have another table (pcalist) that hold a list of contacts for those clients. This stores each name with one of the client id's included in the client table. Each client can have many contacts.

I have a form that currently has a combo box to select the client_name field. If you select a client name then the relevant client_id entry from the clients table is populated in another field using

Me!call_clientID = Call_Client_Name.Column(1)

as an after update procedure (the rowsource for the client name is a query selecting the client name and id).

I would like the same process to provide a second combo box displaying all relevant contacts for that company.

I have tried amending the rowsource query in the client name combox box to include that and then add an addition line to the after update procedure but get and error stating 'type mismatch in expression'

I presume some sort of dlookup could be the key, but I can't get my head round it.

any ideas are greatefully received.

Pete
 
I have made progress on this:

I have a query:

SELECT [PCAlist].[nameandemail] AS nameandemail
FROM PCAlist
WHERE [PCAlist].[clientid]=[FORMS]![Calls]![call_clientID];


that returns the value shown on the form but i cannot get it to display in the list box the results returned from the query. Maybe that makes assistance a little easier.

Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top