?
Solved

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

Posted on 2012-03-22
8
Medium Priority
?
1,345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1000 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
 
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 1000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

770 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