Expression for Lookups?

  • Thread starter Thread starter MBP
  • Start date Start date
M

MBP

I want to build a query with multiple table lookups.

The fields are: Table1.Supervisor (which looks up on the
Supervisor Table), Table1.Agent, Sup1 Table.Agent, Sup2
Table.Agent, Sup3 Table. Agent, etc.

Can I build a query that does the following: IIf
Supervisor = Sup 1, Table1.Agent = Lookup Sup1.Agent,
Department.

So that when I choose a supervisor, the options for the
agent field are limited to the values in the table listed
for that supervisor?
 
It can be done with a little bit of VBA code behind the form.

You can either update the rowsource of the combobox with an inline sql
string or change it to a different query name.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
VBA is a full-blown programming language, so how-to tips will really just
cause frustration. Try taking a training class, then look for the short
cuts.
 
Back
Top