Hi,
I have a form where I have 2 textboxes with dates, FROM_DATE and TO_DATE (this is the base for some queries). In the 2 textboxes I selected SHORT_DATE as format and I created an default value that gives me the in the FROM_DATE the first date of last month and in TO_DATE the last date of last month. This is done by an third (non visible) textbox that select the date of today minus one month, below the expressions.
LAST_MONTH: Control source: =DateAdd("m",-1,Date())
FROM_DATE: Default Value: =DateSerial(Year([LAST_MONTH]),Month([LAST_MONTH]),1)
TO_DATE: Default Value: =DateSerial(Year([LAST_MONTH]),Month([LAST_MONTH])+1,0)
I use this trick already for a long time, never fails...untill now. I have one particular form where I get in the FROM_DATE and TO_DATE #NAME? as result. No matter what I try (like changing format, changing date setting, changing ) it won't change.
When I completely remove it, create them again, it works, untill I close the database, reopen it and it's back again. The weird thing is, I have an older copy of the same database, and there it works perfectly. So I am completely out of solutions.
Also, the LAST_MONTH box doesn't have the problem!
Anybody have an idea what this is causing?