- We have a form where one of the fields needs an expression.
- When we are building that expression, actual need is to select the column name, but we see that there is a property coming up along with the column name with the same name.
- Even if we select the column name, when we save it, it is automatically being changed to form property which is causing the issue in the result.
- We want an expression like this: =IIf([SNAME]="FC";"FC";[STUDENT])
- But when we save it, it is being changed to: =IIf([SNAME]="FC";"FC";[Student])
- STUDENT is a column name which we want to be in the expression
- Student it is shown as a form property in the suggestions but it is not there in the property sheet, we don't know where it is being defined.
- Please check the below screenshot, where you can observe all the above points mentioned
Asked
Active
Viewed 271 times
3

Raj Kumar
- 953
- 1
- 8
- 19
-
1Don't use the same name for different things. – June7 Jan 12 '18 at 05:24
-
Thanks for the response @June7 but we don't know where it is being come from. If we could find that, we would have changed that name. – Raj Kumar Jan 12 '18 at 05:31
-
On form's property sheet select Student control from dropdown listbox, it will select the corresponding control on the form. Rename it to, for instance, `txtStudent` – Sergey S. Jan 12 '18 at 05:36
-
Thank you @SergeyS. We've tried to find it in the form property sheet, but 'Student' is not there in the form property sheet. In fact, this 'Student' form property suggestion is coming in all the forms across the database. So I think it is not specific to a single form, that might be the reason it is not appearing in that form property sheet. – Raj Kumar Jan 12 '18 at 05:41
-
Frankly I don't understand how it was possible to add a custom form property `Student`. Fields and controls have different variable types and corresponding pictures in the list, properties defined using VBA not visible in this list. – Sergey S. Jan 12 '18 at 07:49
-
are you sure IIF command takes semicolon separate sections? I thought it was a comma – Krish Jan 12 '18 at 09:13
-
@krishKM IIF command takes the list separator symbol from our PC regional settings. It will be comma(,) or semicolon(;) based on the region. – Raj Kumar Jan 12 '18 at 09:35
-
And the weird thing is this is happening only in one machine, this issue is not there in any other machines I've tested. 'Student' form-property is not present in any of the machines I've tested, so there is no issue. But this property is visible in one of my machines that is set to Swedish environment. I don't know if different regional settings could be a problem. MS Access version is slightly different at the minor versions level. – Raj Kumar Feb 21 '18 at 05:50
2 Answers
1
If Student is the name of the form, you may try:
=IIf([SNAME]="FC";"FC";[Forms]![Student]![STUDENT])

Gustav
- 53,498
- 7
- 29
- 55
1
From the looks of the screen shot, you have a table named [STUDENT] and a form named [Student]. Check your navigation pane and look for the table and form with the same names, or on the navigation pane, type in the search student and see if it gives you 2 objects.
But if you want your formula to work, try:
=IIf([SNAME]="FC";"FC";[TableName]![columnName])

Chris
- 254
- 1
- 5