I am trying to build a iif statement based on a dlookup to populate a filed on a form. So far I have:
Code:
= IIf((DLookUp( "[SubTeamHeadDelID]" ,"[tblSubTeam]","[Me]![SubTeamHeadDelID] =" & [DelegateID]), [tblSubTeam]![SubTeamParentID] , [tblSubTeam]![SubTeamHeadDelID]))
But this gives an error that there are the wrong number of arguments. What I am trying to do is see firstly if the SubTeamHeadDelID is the same as the DelegateID on the form if so then put the SubTeamParentID into the box and if not put the SubTeamHeadDelID in the box. I have never combined a dlookup with an iif statement so I don't know even if this the correct way of doing it or even if it's possible. Any help would be most helpful thanks.