Solved

MSAccess - Date(), Str() function causing Runtime Error 13 in ACCDE

Posted on 2012-03-22
8
1,266 Views
Last Modified: 2012-03-28
In development, MS Access 2010, queries using the Date() function and Str() function work just fine.

When I compile to an ACCDE however and run under Access Runtime 2010, execution of these queries generates a runtime error 13, type mismatch.

All references are set correctly. If they were not, the functions would not work in development.

Thank you.
0
Comment
Question by:akivashapiro
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 75
ID: 37753501
Do you mean like:

Dim x

x = Date()

and you get a type Mismatch ?

Also, in your dev  environment you can emulate the runtime scenario by starting your db using the Runtime switch off the Command Line ... fyi ...

mx
0
 

Author Comment

by:akivashapiro
ID: 37753622
Actually, not in vba, but in a query:


SELECT Date() AS [Test 2];

You may have to add a table in for the query to run.

I tried it with the runtime swtich, and it still worked in my development environment.
0
 

Author Comment

by:akivashapiro
ID: 37753655
In addition to Date() and Str() it seems also Ucase() does not work.

Please see attached.
Error-3075-Ucase.png
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
ID: 37753768
These are *classic* cases/examples of a Reference issue ... almost ... guaranteed ... can't think of much else at the moment.

mx
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 77

Expert Comment

by:peter57r
ID: 37753778
Are you saying that you have the runtime and the development versions installed on the same machine?

If not, then it just looks like a common references problem.  Any differences in library file locations or versions between the development machine and the runtime machine  can cause reference failures.
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 250 total points
ID: 37753971
I have to agree that you are probably having a reference issue.
All of the references MUST have the exact same path on the development machine and the production machine.

32-bit machines vs 64-bit machines (Program Files vs Program Files(x86))
Office 2003 vs Office 2007 vs Office 2010 (Office 10, Office 11, Office 14)
Different drives (c: d: ect)

If the run-time isn't installed to exactly the same path as the full-blown Office, you may have grief.  Look at the path to MsAccess.exe on both machines.  Is it an absolute match?
0
 

Author Closing Comment

by:akivashapiro
ID: 37777523
I found the solution. The development machine was running Office 2010 and the production machines are running Office 2007. Three type library's referenced in development did not exist on the production machines for Outlook, Excel, and Word 2010.  I copied those type libraries to the production machines on the same path and it worked. <br /><br />What is strange is that instead of an error at load time or an error that indicated an "unknown function" or some such, I got a type 13 type mismatch error. <br /><br />Thanks for your input.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 37779452
Busted references tend to make mundane function stop working--which is why all of us were pretty sure that you had a reference issue.  The error messages tend to be misleading.  What happens is that fairly mundane functions run, and they are known by the VBA code, but they have some dependencies on the busted references, and then things go BANG!

Glad you got it figured out!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now