M
Maresdd
I am trying to lookup information from a table using the dlookup function.
Using a subquery worked beautifully but it won't allow me to use a subquery
in a query for a report. The following is what I have so far, but I keep
getting a error "Invalid Syntax". Could someone please take a look at my code
and tell me where I'm going wrong.
Rates:
IIf(IsNull(DLookUp("[Rate]","[tblRates]","[qry_ServMiscInv]![ServDate] & "
Between [StartDate]
and [EndDate] And [ServiceType] = '" & [ServiceType] & "' And [RateID] = " &
[tblCustomer_Details]![RateID] &
"")),IIf([Sleepover]=True,tblContracts.SORate,tblContracts.Rate,DLookUp("[Rate]","[tblRates]",[qry_ServMiscInv]![ServDate] & " Between [StartDate]
and [EndDate] And [ServiceType] = '" & [qry_ServMiscInv]![ServiceType] &
"'And [RateID] = '" & [tblCustomer_Details]![RateID] & "'"))
thanks in advance
Using a subquery worked beautifully but it won't allow me to use a subquery
in a query for a report. The following is what I have so far, but I keep
getting a error "Invalid Syntax". Could someone please take a look at my code
and tell me where I'm going wrong.
Rates:
IIf(IsNull(DLookUp("[Rate]","[tblRates]","[qry_ServMiscInv]![ServDate] & "
Between [StartDate]
and [EndDate] And [ServiceType] = '" & [ServiceType] & "' And [RateID] = " &
[tblCustomer_Details]![RateID] &
"")),IIf([Sleepover]=True,tblContracts.SORate,tblContracts.Rate,DLookUp("[Rate]","[tblRates]",[qry_ServMiscInv]![ServDate] & " Between [StartDate]
and [EndDate] And [ServiceType] = '" & [qry_ServMiscInv]![ServiceType] &
"'And [RateID] = '" & [tblCustomer_Details]![RateID] & "'"))
thanks in advance