473,545 Members | 1,797 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 14315
zmbd
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).

-Stewart
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
jimatqsi
1,273 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

Jim
Jun 23 '20 #6
NeoPa
32,564 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

3
6086
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
1
5232
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")
3
17041
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...
8
5341
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...
3
4693
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 line of code: Me!txtLostDaysNoPaySeasonal = DSum("getNumberOfWeekdays(!, !)", "qryTest", "! = 'BK21312'") In this, getNumberOfWeekdays is a...
6
6480
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...
2
9824
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...
2
5025
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,...
1
5074
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...
4
2050
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:
0
7487
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, 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...
0
7420
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
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. ...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
isladogs
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...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3459
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1033
muto222
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.