Need help with syntax

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

Hi to all on this monday morning,

After spending an hour on how to write this, it look like I need some help
can anyone tell me what is my mistake here:
I am always getting the following error, "expression contain invalid
syntax"

=DLookUp("[AnnualRate]","RenewalOptions","[SR-SommaireImmobilierRenOptions].Report![ClientNumber]=
[ClientNumber]
AND [SR-SommaireImmobilierRenOptions].Report![To] >
DMin("[To]","RenewalOptions","[SR-SommaireImmobilierRenOptions].Report![ClientNumber]=[ClientNumber]
AND [To] > Now()")")

If I remove the DMin function from the Dlookup both work just fine with the
exprected results but when I combine both then error

TIA

Alain
 
Hi Alain,

It looks as if you're including the DMin() sub-expression inside a
literal string. Try ending the literal before the DMin(), e.g.
[To] > " & DMin("[To]"
and adjusting the quotes at the end of this unmaintainable monstrosity.

Better yet, push it off into a VBA procedure where it belongs!

Hi to all on this monday morning,

After spending an hour on how to write this, it look like I need some help
can anyone tell me what is my mistake here:
I am always getting the following error, "expression contain invalid
syntax"

=DLookUp("[AnnualRate]","RenewalOptions","[SR-SommaireImmobilierRenOptions].Report![ClientNumber]= [ClientNumber] AND [SR-SommaireImmobilierRenOptions].Report![To] > DMin("[To]","RenewalOptions","[SR-SommaireImmobilierRenOptions].Report![ClientNumber]=[ClientNumber] AND [To] > Now()")")

If I remove the DMin function from the Dlookup both work just fine with the
exprected results but when I combine both then error

TIA

Alain
 
Back
Top