473,387 Members | 1,882 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,387 software developers and data experts.

Microsoft Access can't find the name 'Empty' you entered in the expression

4
Hi to all...

Would greatly appreciate any suggestions.

I'm trying to evaluate an expression during run-time that looks something like this:

Eval("RecordAdd_Addresses(False,"John","","Doe","N ew York","NY","11216","US","12345678","","",Empty,Emp ty,Empty)")

I get this error:

"Microsoft Access can't find the name 'Empty' you entered in the expression"

I have no idea what to do, completely blank about this error....

Please note that I have to use my convention for calling this method as shown (otherwise I would have to re-edit about 60 thousand lines of code).

Eval() works fine for me, but when using Empty as an argument to a function I get the error.

Thanks in advance.

Ilan
Mar 12 '08 #1
2 4507
Stewart Ross
2,545 Expert Mod 2GB
Hi. The 'Empty' argument is not appropriate with Eval. What is passed to Eval is a string expression which is evaluated at run-time. The string you pass has no connection to the code in which the Eval statement is running, and in this context the reference to Empty within the string does not result in Eval interpreting Empty as your VB code would (as a placeholder for an uninitialised variant variable).

As an example to try to see more clearly why Eval can't interpret Empty, Eval can be used to evaluate an expression entered by the user at run time. If a user entered 20 * 40 Eval will return 800. If a user entered CInt(2.57) Eval will return 3. But, if a user enters CStr(Empty) a run-time error results, as Empty is only valid in VB code, and it simply cannot evaluate it.

I think you need to modify the header of your function RecordAdd_Addresses to set default values for the arguments passed to it. This would allow you to rewrite your Eval statement to do away with the Empty arguments altogether.

-Stewart
Mar 12 '08 #2
ilany
4
I appreciate your help. I'll try that.
Mar 12 '08 #3

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

Similar topics

10
by: David Graham | last post by:
Hi I have been busy going through the last weeks postings in an attempt to absorb javascript syntax (I guess it's not possible to just absorb this stuff in a passive way - I'm getting way out of...
3
by: Stan | last post by:
Hallo, I have developed an application in MS Access 2000 (Polish version) under MS Windows XP prof (also Polish). Now I would like to run this code on MS Windows XP EN and MS Access XP EN. I have...
0
by: JMCN | last post by:
hi- this function IDSpecialCases works great in access 97 in the query builder but why doesn't it work in access 2003? would does anyone have any wild guesses? is it a problem with the dao...
7
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
2
by: Paolo | last post by:
Hi to all, I have an error that drove me crazy. Try the following page that should only allow to upload a file: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">...
1
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions ...
2
by: jthep | last post by:
I'm trying to get this piece of code I converted from C to work in C++ but I'm getting an access violation error. Problem occurs at line 61. Someone can help me with this? The function...
4
by: zufie | last post by:
I have a main form containing a command SEND button that prompts an email form to pop up. The email address(es) that are supposed to appear on the email form are those corresponding to the...
2
by: shalskedar | last post by:
I 've created Report in Ms access which contains subform.The field value in the report is retrieved from the subform.When this report is exported,it shows the error as The expression you entered has...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.