Iff statements

  • Thread starter Thread starter Anne
  • Start date Start date
A

Anne

I have a form with a field [ProjectName] - the user types in the name of the
project. This is set as a required field in my Table. On the same form I
have a field [ClientID] - this is not a required field. I also have a field
[TILClientYes/No] which is also not a required field. If the
[TILClientYes/No] is select as "Yes" then I want the [ProjectName] to Default
to information selected in [ClientID] field.

I have tried adding this line to my Control Source of the [ProjectName]

=IIf([TILClientYes/No]=Yes,[ProjectName]=[ClientID],[ProjectName]=[ProjectName])

I also tried putting it in the Default in properties for the [ProjectName].

I also tried.

=IIf([TILClientYes/No]=Yes,[ProjectName]=[ClientID],[ProjectName])

I can't get it to work yet. I think I need the end of my line to say "allow
data entry" but have no idea how to do that.

The fields on the form all refer to the same Table.
 
You got to use an alias like this --
Project_Name: IIf([TILClientYes/No]=Yes,[ClientID],[ProjectName])
 
Back
Top