Need help with syntax

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
 
J

John Nurick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top