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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup with mulitple criteria on after exit 1

Status
Not open for further replies.

air1jcw

Technical User
Jan 23, 2003
30
US
I have a form that I am working with. I am using the DLookup function. Here is my example:

varFLEETTYPE = DLookup("FLEETTYPE", "Fleet Effectivity", "!IID =[IID]")

varCPWOH = DLookup("OH", "gtiaiq", "[MATL TYPE]= 'SV' And [GTWY]= 'CPW'")

The first lookup (varFLEETTYPE) works fine. It returns the value based on what value is in the field [IID] on the form with no other criteria.
The second lookup up is what I am having trouble with (varCPWOH). I need for it return a value based on the value in the [IID] (field on form} AND with the criteria I have selected.

Any fixes for this?? If more info is needed - please advise.

Thank you in advanced!!

air
 
air
I think you might have to bracket the criteria and then add the IID field.

Try this...
varCPWOH = DLookup("OH","gtiaiq","([MATL TYPE]= 'SV' And [GTWY]= 'CPW') And [IID] = " & [Forms]![YourFormName]![IID] & "")

I think that's close.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top