Okay, I've got some weirdness going on in my vba script and I'm not sure why. I have a script that is comparing the hour that is hardcoded to a form against the hour of the current time.
Code:
me.FormHrtxt = Hour(now())
If it is equal then other script runs, if not then nothing happens and the page is locked. It works fine in my development version of the database. However, when I import the script into the user version of the database, which is essentially the file I made the development copy from, it no longer functions as expected.
In normal scripting the Hour function shows as what I just typed - the word hour with a capital H. In the user database the hour function has changed to the word hour with a capital H and O - it now looks like this in the script HOur(Now()). I'm getting alternating error messages when the page loads/script runs. Either 'datatype mismatch' or 'can't find field HOur in expression'. I have no idea why this is happening. Older script that has the Hour() function in it now shows HOur() as well - but those seem to be working alright.
I've modified the newer script I brought over to use the Datepart() function:
Code:
Datepart("h",(Now())
So it's working as intended, but I am at a loss as to why the Hour() function is no longer running as expected. My initial assumption is that the dbs is corrupted somehow. I did try opening a blank dbs and importing over the components of the original and I found the same issue. However a new database without the import sees the Hour() function correctly.
It's all a bit maddening - and caused me quite a bit of cursing until I changed over to the Datepart() function. Has anyone ever experienced this problem? Any ideas? Or should I just chalk it up to the Access gremlins?
Thanks,
DD