I have a simple form that has fieelds for student given names (and preferred name) and family name for data entry.
At the top of the form I have two fields that the user can’t change. These fields are to be the family name field and preferred name (depending on whether one is entered) or the the given names.
Basically it is a “friendly name” at the top of the form for users as a confirmation that they are working with the desired student (but they can check the given names for confirmation).
I have used an IIF function to check whether the preferred name field is blank (and then use the given names) but this is showing the #Name? (as if the Control Source is not defined correctly).
This is the code I tried. Where am I going wrong, please?
txtFirstNames.Value = IIf(Me.txtPreferredName "", [txtPreferredName], [txtGivenNames])