Syntax error

mapat

Registered User.
Local time
Today, 15:03
Joined
Feb 2, 2007
Messages
176
Hello, I have the following on the control source of a text field:
=IIf([pcSSISSA]=True,DLookUp("[Reason]","[MissingFormReasons]","[ID]"="[pcSSISSAtext]"))

being:
[pcSSISSAtext] an integer
[ID] an integer

it is giving me an error, what would be the right syntax?

Thank you
 
Try and remove the quotes marked RED

Code:
=IIf([pcSSISSA]=True,DLookUp("[Reason]","[MissingFormReasons]","[ID][COLOR=red]"[/COLOR]=[COLOR=black]"[/COLOR][pcSSISSAtext][COLOR=red]"[/COLOR]))

JR

Edit: missing a "&" try this:

Code:
=IIf([pcSSISSA]=True,DLookUp("[Reason]","[MissingFormReasons]","[ID]=" & [pcSSISSAtext]))
 
Last edited:
I think you’re missing the 3rd argument. You have no argument for the False situation.
Your Dlookup is your 2nd argument.
 
I added the 3rd argument to the iif function, and have tried deleting the red quotes and have tried different combinations and is still not working. Any other ideas?

Thanks
 
Does it look anything like this now?

=IIf([pcSSISSA]= True, DLookUp("[Reason]","[MissingFormReasons]","[ID]=" & [pcSSISSAtext]), "false Argument")

- What is pcSSISSA, is it a true/false control on your form?

JR
 

Users who are viewing this thread

Back
Top Bottom