Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date function on form 1

Status
Not open for further replies.

ErnNJ

Programmer
May 2, 2002
21
US
I cannot access the Month() property of a Date data type, but I can access the Year() and Day() on the same form. When I try to get the month, I get a type mismatch error, but again not with year and day. Why would the month not be accessable but the year and day are? Please HELP!!!
 
You probably have an object name conflict. Do you have a USER GENERATED object called MONTH anywhere?....

That's the only reason you would get this "Type Mismatch" error - if your MONTH object is TEXT datatype, for example. How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Thanks Hare,

I have text box on my form and the record source is a field named Month. I cant believe that would take away the month function from the Date object. I have a lot to learn.

 
Well, don't be discouraged. Generally, it's a "no-no" to name objects using any language's keywords or reserved words, but sometimes the problem is that one hasn't the foggiest what all the reserved words or keywords are until you run up against them, and Access/VBA probably has about 500 of 'em...

The upshot is, when you name something "MONTH", then YOUR "month" trumps Access's "MONTH()" function.

Jim



How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top