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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Month function works in module not in object class

Status
Not open for further replies.

Prattdakota

Vendor
Jan 10, 2003
38
0
0
US
I have a form which has a command button on it. The On Click event of the button invokes the class object form code which uses the Month function as follows:

Code:
Dim x As Integer
x = Month(#10/5/2004#)

When run, the code produces a type mismatch error. If I run this same code in a module it works fine and x turns out to be 10. If someone could enlighten me as to the reason the function doesn't work in a class object I would be grateful.

Thanks
 
And this ?
x = VBA.Month(#10/5/2004#)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top