Hi guys,
I'm trying to do what I thought would be very simple, but...
I added an unbound textbox to a form. The user will enter the 4 digit year into the box to filter an underlying query. 95% of the time, the year will be the current year, so I'd like to set that as default for the field. Based on several posts I've tried =YEAR(date()) and =DatePart('yyyy',Date()) as well as wrapping as a character string =CStr(Year(date())).
However, when I open the form I just get a '#Name?' error in the field. When I researched that the common theme seems to be naming the field something that creates a circular reference on the form, but the name of the field is txtCurrentDate and there's nothing else on the form with 'year' or 'date' in the name.
What the heck am I doing wrong here? I'm sure it is simple. Please ridicule me... I feel deserving. :banghead:
I'm trying to do what I thought would be very simple, but...
I added an unbound textbox to a form. The user will enter the 4 digit year into the box to filter an underlying query. 95% of the time, the year will be the current year, so I'd like to set that as default for the field. Based on several posts I've tried =YEAR(date()) and =DatePart('yyyy',Date()) as well as wrapping as a character string =CStr(Year(date())).
However, when I open the form I just get a '#Name?' error in the field. When I researched that the common theme seems to be naming the field something that creates a circular reference on the form, but the name of the field is txtCurrentDate and there's nothing else on the form with 'year' or 'date' in the name.
What the heck am I doing wrong here? I'm sure it is simple. Please ridicule me... I feel deserving. :banghead: