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!

Format(Now(), "yy") Generating Error

Status
Not open for further replies.

WAR40K

Technical User
Oct 29, 2003
29
0
0
US
I have some users on Access 2k who are using an application dependent upon VB scripting. One script calls out
getDate = Format(Now(), "yy").
evertime the script is executed the program stops on this line and retuns the message "Can't Find Project or Library"

is there a work around to this code that will work in Access 2k? Basically what I want to store is the last two numbers of the current year so that I can compare it to a pre-existing value to see if my record numbering system needs to be reset.

Thank you, I look forward to any and all replies.
 
hi,

Format is not in VB Script. BUMMER!
Code:
getDate = Right(CStr(Year(Now())),2)


Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
BTW,

I'd PREFER to call the variable...

getYr2 or sumthin' like thet since it is NOT A DATE!

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
Thanks skip, I'll give it a try this afternoon.
 
Hey Skip,

Thanks for your help, code you gave me worked perfectly.

 
Uh...I have a user with Access version 9.0.6620 and I'm getting the "Can't find Object or Library" message at the "Right(Cstr(Year(NOW())),2)"

any suggestions for another workaround, or am I missing something basic?

by the way, I'm still storing the value in the variable getYear (which is defined as a string).

muy thanks in advance
 
It not ACCESS its the VBA Library

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
Can I upgrade the library w/o upgrading Access?
 
I'm guessing its NOT an UPGRADE issue, but rather a LOST .dll file.

Have him uninstall/reinstall Access

Skip,
[sub]
[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top