473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Undefined Function 'Date' in expression

Seth Schrock
2,965 Expert 2GB
I'm getting an error when trying to open my database on a user's PC: Undefined Function 'Date' in Expression. From looking online, it looks like it is a reference issue. The problem is that the user is using Access Runtime so I can't check the references in the VBA editor. Is there any other way?
Apr 17 '13 #1
6 14276
zmbd
5,501 Expert Mod 4TB
Create you a shortcut to the regular Access program (ie cut and paste) edit the short cut so that you now have:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" /runtime
Rename it so that you know that the shortcut opens in runtime.

Now drag and drop your database file ontop of this shortcut.

This will allow you to check how your database will work (or not ;) ) when using the MSRT.

Provided all of your references are correct on your PC then the file should work fine. If it does then there is an issue with the installation on the client PC.
Apr 18 '13 #2
Seth Schrock
2,965 Expert 2GB
I think that I have solved the issue. We had a spare copy of Access on the shelf so we installed it on the trouble PC. The Microsoft Common Control Library reference was missing. I fixed this and it works. I just need to make sure that it still works once I remove the full version of Access. I just wonder why this reference was causing a problem with the Date function.

I'm in the process of finding code online to test the references to see if they are broken and if they are, to reconnect them. So far, I've read that this would be called from an AutoExec macro so that it can run before any form gets loaded.
Apr 18 '13 #3
Stewart Ross
2,545 Expert Mod 2GB
Hi Seth. The Date() function problem is a manifestation of the built-in VBA library itself no longer functioning. You would find if you took out the first line on which the Date() problem occurred you would likely get a failure at the use of whatever was the next VBA function called.

In a full Access database this is not so much a reference issue as one of corruption of the database concerned, or as a result of competing versions of DLLs being present in installations where there are multiple versions of Access active (e.g. A2003 and A2007).

-Stewart
Apr 18 '13 #4
Seth Schrock
2,965 Expert 2GB
Well, out of nine PCs running this database (all FEs copied and pasted from the same file) only one is having this issue. Also, copying and pasting again did nothing to fix it, so I'm not sure corruption is the case here. Looking online, I found many cases of this that were fixed by fixing the references. I was just surprised that the reference that was missing in my case was the MS Common Control Library and not the Office 14 or the Access 14 reference.

Anyway, I'm now in the process of removing the full version of Access to test it with just Access Runtime.

Side note: I have had this issue before with another database. I solved it by rebuilding the form that time, but at the time I didn't have any extra Access license to get the references fixed, so I was hoping that
Apr 18 '13 #5
jimatqsi
1,271 Expert 1GB
This problem can be caused by installing 64-bit Access and 32-bit Access. In my experience, folks install 64-bit Office/Access, discover what a bad idea that is because of all the 32-bit supporting code they've got, then removed 64-bit and install 32-bit. Then, bingo, you've got this problem.

Sometimes I've been able to solve this by simply copying the Microsoft Common Code folders relevant to MS Office (C:\Users\Jim\Documents\Clients\SMI\Microsoft Shared) but today that didn't work. So I found this thread and started experimenting. I created a new Access database, imported everything and that appeared to work.

Then I started over. I couldn't find the missing reference. So I decompiled the app and that did everything I needed! So, at least in some cases, decompile the app is all you have to do. The command line entry for that in my case today is :
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE" "C:\Users\Public\Access\QSI.mdb"  /decompile
Change this depending on what version of Office/Access you're running and the path to your database file.

Thanks again to all the experts and contributors at Bytes.com

Jim
Jun 23 '20 #6
NeoPa
32,556 Expert Mod 16PB
Thanks for that Jim. Very helpful.

Just to add to what you've already said, these addresses can be found using the environment variables {USERPROFILE}, {ProgramFiles(x86)} & {PUBLIC} thus :
Expand|Select|Wrap|Line Numbers
  1. %USERPROFILE%\Documents\Clients\SMI\Microsoft Shared
  2. %ProgramFiles(x86)%\Microsoft Office\root\Office16\MSACCESS.EXE" "%PUBLIC%\Access\QSI.mdb" /decompile
This ensures that the strings are portable between systems.
Jun 23 '20 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ronald W. Roberts | last post by:
I'm not sure where this routine came from, but here is the problem. On certian computers this error occurs, but it does not on others. The error is: "Undefined Function "DIR" in expression". ...
1
by: Simon | last post by:
Dear reader, According the manuals it has to be possible to work with "Format" in queries. But in case I use the following expression in a query: Format(;"yyyy-mm-dd") Or...
3
by: carrionk | last post by:
Hi, I'm running an ADO Recorset from Excel to gather data from Access. Basically it's copying the records of a query -that runs without problem in Access- That query has an expression with NZ()...
8
by: Wade | last post by:
My query contains a field called TotalIn, which returns number data from an underlying table. I have modified a function, PrevRecVal, which returns the datum form the previous record in the TotalIn...
3
patjones
by: patjones | last post by:
Good morning all: In what seems like an ongoing saga to make the DSum function do what I need it to, I am now having trouble with a user-defined function in my VBA module. Here's the offending...
6
by: blackdogharry | last post by:
Hi, I am a novice VBA user. My access version is 2007 on Windows XP PC. I need to create a query that will take pre-existing text values of the B_status field (such as "Received_Emailed",...
2
by: CCHDGeek | last post by:
I created a database with a separate front-end that is installed on each computer and linked to a back-end server. After installing the file on several computers, I realized I was getting this...
2
by: rmmahara | last post by:
Hi Folks, I've been reading these forums for a while and now I'm in desperate need of help, so I thought I'd post! Background: I'm creating a Service Dashboard to track my team's adherence...
1
by: nlulla | last post by:
Hi I am trying to get all rows from a datatable where the first column F1 is a date, as this datatable is created of excel, i only want to deal with rows where the first column is having a date in...
4
by: William Hamilton | last post by:
Hi all, Hoping someone might be able to point me in the right direction with getting the code below to work properly. Effectively, the code: Requerys the listbox in lstPrintCheckedStaff...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.