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

Date() and Str() functions not working in a particular database

Status
Not open for further replies.

buchanp

Programmer
May 16, 2003
5
US
I have a MS Access 2000 database that has reports. One of the reports uses the Str() and Date() functions in a text box control. Recently, these functions began failing. What happens is the user receives an input box for Str when they try to run the report.

I created a test database and with a little report in it that uses these functions. The same user can run this report without issue but if I copy the test report from the test database to the other database and they try to run it, they get the error again.

What gives? How can Access just forget about a function? I ran Compact and Repair database utilities on it but it still didn't help. Has anyone else had this happen to them? I'm at a loss. Any help would be greatly appreciated.

thanks,

pat

 
Check your Library References. Open some code and then Tools > References. See if one is missing. Visual Basic for Application, MS Access Object Library , and MS Access DAO Object library. Different versions for different MS Office version. But, one of these is probably not available on this PC. If missing, you will have to reload it. If just not selected, select it and you are back in business.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Thanks for the response.

This sounds crazy but I don't have "References" underneath my Tools drop-down menu. I even found a reference to what you are talking about in the Help documentation but I don't have it. I'm using Access 2000. Here is what I have:

Tools >
Spelling
AutoCorrect...
Office Links
Online Collaboration
Relationships...
Analyze
Database Utilities
Security
Replication
Startup...
Macro
ActiveX Controls...
Add-Ins
Customize...
Options...

That's it! No "References"

Also please note that I can run the same functions without issue in another report in another Access 2000 database on the same machine without issue. If an installation was the issue, then it wouldn't run in any database right?
 
Click on the Forms tab in Design Mode. Now click on the Code button so that your focus moves to a code section of a form.(any form). Now look under your Tools menu. You will now see a References selection available. Select it.

You are now looking at a scrollable list of library references. You probably will see one that is marked as MISSING. This is the one that you need to reload.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
You are right. The user's computer is missing the following:

Microsoft DAO 2.5/3.5 Compatibiltiy Library

However, I can remove this reference and still have no problem on my machine but the user's does.

Does Str() and Date() functions come from this component? I have a work around now. I just call the Now() function instead but it still bugs the hell out of me that it just decided to stop working! Any ideas?

Thanks for your posting!

 
Here is a link that explains the libraries that are necessary and compatibile for each version of ACCESS:


I have the following for my ACCESS 97:
VB for Application
MS ACCESS 8.0 Object Library
MS DAO 3.51 Object Library

My ACCESS 2000 has the following selected:
VB for Application
MS ACCESS 9.0 Object Library
MS DAO 3.6 Object Library
MS ActiveX Data Objects 2.1 Library

I hope this helps.


Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???
 
Yes, it does. Thanks for all the info!

pat
 
Thanks GingerR. That looks like some great information on my issue. I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top