473,836 Members | 1,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined Function 'Date' in expression

Seth Schrock
2,965 Recognized Expert Specialist
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 14401
5,501 Recognized Expert Moderator Expert
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 Recognized Expert Specialist
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 Recognized Expert Moderator Specialist
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).

Apr 18 '13 #4
Seth Schrock
2,965 Recognized Expert Specialist
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
1,278 Recognized Expert Top Contributor
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\D ocuments\Client s\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

Jun 23 '20 #6
32,584 Recognized Expert Moderator MVP
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(x 86)} & {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

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". The form open event calls the CheckandRepairLinks without a varable being passed it it. CheckandRepairLinks
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 Format$(;"yyyy-mm-dd")
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() function. Used to sum two separate fields because I found that if there is a null field an addition operation is not performed. When running the ADO Recorset, I get the following message:
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 field and places it into a field called PrevTotalIn. To accomplish this I inserted, into the query, a new field containing the expression referencing the function. I ran the query and it returned the desired result. However, I then saved the module...
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 line of code: Me!txtLostDaysNoPaySeasonal = DSum("getNumberOfWeekdays(!, !)", "qryTest", "! = 'BK21312'") In this, getNumberOfWeekdays is a function that I define elsewhere in the module, as such: Function getNumberOfWeekdays(dteStartDate...
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", "Processed" etc.) and return the numeric value depending on the value of the B_status value. So I would get 2 in the new field if the value of B_status is "Received_Emailed" and so on. I opened Visual Basic Editor and created a function under...
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 error: Run-time error '3085': Undefined function 'Date' in Expression. I did some research and found out that it's an issue with my references. So, I was able to fix it. But my concern is if I make changes to the front-end and need to update everyone's...
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 to Service Levels. As part of this, I've set up a web page which pulls data from a query in Access 2003. The page shows which tickets we're working on, how long they've been open, the service level for each ticket etc. Since we're a 9-5, Monday to...
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 it. For Each drow As DataRow In dt.Select("isdate(F1)") .....code here stripped off , but was to loop through all columns NEXT but i get following error when i run the above code "The expression contains undefined function call isdate()"
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 Selects all the items rows in lstPrintCheckedStaff Then for each row in the list box:
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.