RE: Day() function - fine in one form, Error 2465 on another.
- From: Helen <Helen@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 May 2009 04:54:02 -0700
Thanks for the quick reply!
I've taken to using Int(Now()) in place of Date() because when I gave the
file to a friend, Date() didn't work. Poked around the forums and found that
others had the same problem - Now() worked fine, but Date() didn't. The
advice realted to referencing errors which was really ugly to fix, given that
the friend is in another country. Using the Int solved THAT problem very
simply.
'Defatult' doesn't seem to be the problem (but I can easily change that to
check), as when I put a watch on the value of Default, it's as it should be -
today's date, with format 'Date'. The debugger hangs up on the Day function
- seeking a field instead of just doing the function.
"Jack Leach" wrote:
I'm not sure if this is the problem or not, but just out of curiousity, why.
use int() instead of standard a standard date or format function?
Also, I would guess that Default is a reserved word.
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"Helen" wrote:
Two forms need command buttons to do the same thing. The code was working
perfectly on one form, so copied it over to the other.
Get error 2465 = Can't find the field 'Day' in your expression.
Relevant code:
Dim Default as date
Dim DDay as integer
Default = Int(Now())
DDay = Day(Default) --------------this line is highlighted by the debugger
If today is the 15th of May, one form works fine: Default = 15/5/09, DDay = 15
The other form gives the error. Default shows as above, but "Day(Default)"
in the watch zone shows the error. There is no field called "Day" on the
second form.
I'm perplexed.
- Follow-Ups:
- References:
- Day() function - fine in one form, Error 2465 on another.
- From: Helen
- RE: Day() function - fine in one form, Error 2465 on another.
- From: Jack Leach
- Day() function - fine in one form, Error 2465 on another.
- Prev by Date: Re: Adding Mutiple Where Statements to Code
- Next by Date: RE: Day() function - fine in one form, Error 2465 on another.
- Previous by thread: RE: Day() function - fine in one form, Error 2465 on another.
- Next by thread: RE: Day() function - fine in one form, Error 2465 on another.
- Index(es):
Relevant Pages
|