AndyCompanyZ
Registered User.
- Local time
- Today, 02:03
- Joined
- Mar 24, 2011
- Messages
- 223
I am trying to write a piece of code that will show me an ID number from a table if certain criteria is met. The code I have so far is:
this is on the control source of the textbox. But it is gving me an invaild syntax error and I'm not sure where. What the code should do islookup the tblSubTea, and look for the SubTeamHeadDelID and if it is the same as the DelegateId then it shows the SubTeamParentID from the tblSubTeam and if not then show the SubTeamHeadDelID. I'm not sure if this is the correct use of the IIf statement as it's the first time I've tried using it hence the syntax error.
Code:
= IIf(DLookUp( [tblSubTeam]![SubTeamHeadDelID] ,[tblSubTeam], = [DelegateID])), [tblSubTeam]![SubTeamParentID] , [tblSubTeam]![SubTeamHeadDelID]
this is on the control source of the textbox. But it is gving me an invaild syntax error and I'm not sure where. What the code should do islookup the tblSubTea, and look for the SubTeamHeadDelID and if it is the same as the DelegateId then it shows the SubTeamParentID from the tblSubTeam and if not then show the SubTeamHeadDelID. I'm not sure if this is the correct use of the IIf statement as it's the first time I've tried using it hence the syntax error.