?
Solved

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

Posted on 2012-03-22
8
Medium Priority
?
1,397 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

850 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