473,770 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The expression you have entered is too complex

I am trying to get around the problem "The expression you have entered
is too complex" for a select query. (The example below is not the
expression that is giving me headaches.)

So I am thinking that I just need to do the parsing and calculating in
an event procedure for an "On Click" event.

My question is:

If I have a query field in access97 that parses date (in format
"MM/DD/YYYY") of a field [DOB] in a table like:

BIRTHDAYNUM:Val (Left((Mid([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),InStr((Mi d([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),"/")-1))

(I know that I could do this some other way inside the query to get
the day but I want to learn how you would communicate between an event
procedure and a query [GET_BIRTHDAYNUM _Q] called inside the event
procedure: Private Sub GET_BIRTHDAYNUM _Click().)

What would the code need to be so that I am able to pull the data from
the field [DOB] in each record in a table [Employee], manipulate it,
and then put the result into the field [BIRTHDAYNUM]?
Nov 12 '05 #1
2 6077
sa****@uni.edu (Mikel) wrote in message news:<7c******* *************** ****@posting.go ogle.com>...
I am trying to get around the problem "The expression you have entered
is too complex" for a select query. (The example below is not the
expression that is giving me headaches.)
Not sure why you haven't posted the actual problem, but maybe my
solution to the problem you DID post will help you with the solution
you seek.

The "too complex" error is usually related to too many nested IFs,
which I don't see below. As a matter of fact, in your example below,
you should not be getting the error message at all. It should work.
My question is:

If I have a query field in access97 that parses date (in format
"MM/DD/YYYY") of a field [DOB] in a table like:

BIRTHDAYNUM:Val (Left((Mid([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),InStr((Mi d([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),"/")-1))

My solution, for your query value, use this instead:
BIRTHDAYNUM: Format([DOB],"dd")
(I know that I could do this some other way inside the query to get
the day but I want to learn how you would communicate between an event
procedure and a query [GET_BIRTHDAYNUM _Q] called inside the event
procedure: Private Sub GET_BIRTHDAYNUM _Click().)

What would the code need to be so that I am able to pull the data from
the field [DOB] in each record in a table [Employee], manipulate it,
and then put the result into the field [BIRTHDAYNUM]?


My guess would be to put the following code in your On Click event:

[BIRTHDAYNUM]=Format([DOB],"dd")

Dennis
Nov 12 '05 #2
sa****@uni.edu (Mikel) wrote in message news:<7c******* *************** ****@posting.go ogle.com>...
I am trying to get around the problem "The expression you have entered
is too complex" for a select query. (The example below is not the
expression that is giving me headaches.)

So I am thinking that I just need to do the parsing and calculating in
an event procedure for an "On Click" event.

My question is:

If I have a query field in access97 that parses date (in format
"MM/DD/YYYY") of a field [DOB] in a table like:

BIRTHDAYNUM:Val (Left((Mid([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),InStr((Mi d([DOB],(InStr([DOB],"/"))+1,(InStr((I nStr([DOB],"/")+1),[DOB],"/")))),"/")-1))

(I know that I could do this some other way inside the query to get
the day but I want to learn how you would communicate between an event
procedure and a query [GET_BIRTHDAYNUM _Q] called inside the event
procedure: Private Sub GET_BIRTHDAYNUM _Click().)

What would the code need to be so that I am able to pull the data from
the field [DOB] in each record in a table [Employee], manipulate it,
and then put the result into the field [BIRTHDAYNUM]?


you could use the standard VBA-functions cdate or datevalue (also
accepts monthnames) or - if the system-defaults, calendar-property of
the project don't comply with the notation to convert you also can
write a public VBA function in a module to use within your
SQL-expression. When using Jet/DAO this will work. I don't have
experience in the ADO-environment.
It is also possible that some other problem in your SQL-expression is
the cause of the error-message.

Marc
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2040
by: belzibob | last post by:
I have an Access 2000 MDE that I can deploy via Wise 9.0 for Windows script successfully to 95/98, NT, 2000, XP, Xp/pro, and Me. This works fine in all environments on any number of pc's so I am convinced the app and the load process are working fine. There is one pc running 2000 servicepak 3 that gets the error, "The expression you entered has a function that <app_name> can't find" This happens on startup with the MDE (which again,...
3
19559
by: CLarkou | last post by:
On a client's machine with Office 97, my access program gives an error "The Expression you entered refers to an object that is closed or doesn't exist" when I am assigning a value in the checkbox. chk_multiuser.Value = 0 What could be the cause of this error ?
3
1597
Fotorat
by: Fotorat | last post by:
I did this code converts a date into a value -1 to -12 to be used in crosstab report headers. The problems arises when I insert the last IIF statement for month -12!!! up to -11 it runs and works but I get The Expression you entered is to complexwhen I inseert the last iff for -12. Any ideas??? this is what tips it over: ,IIf(DatePart("m",)=DatePart("m",(DateAdd("m",-12,Now()))),"-12")
1
2061
by: sumit205 | last post by:
Error 2467:The Expression you entered refers to an object that is closed or doesn't exist . DoCmd.OpenForm frm2, WindowMode:=acDialog, OpenArgs:="c" & NewProductID In the debig mode when i place my cursor on the OpenArgs it displaye the error "the Expression you entered refers to an object that is closed or doesn't exist ." what could be the problem Sumit
6
6584
by: weston | last post by:
In Access 2000 I have a form with a tab control with 3 tabs. I have a button that is supposed to check if each question on the form has been completed. The code that is under this button is below. It works for the questions on the first 2 tabs but when it gets to the questions on the 3rd tab I get the following error message "The expression you entered refers to an object that is closed or doesn't exist". This code does work properly on...
5
26432
by: curtok | last post by:
I am having trouble trying to get and expression to work. I keep getting the same syntax error, you may have entered and operand without an operator. What i am trying to do: one field contains a number which start with either a 1, 2, 3, or 4 and I want the previous field to automatically fill in a correct item based on what the number starts with. This is the expression that I was trying to modify >...
2
4772
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 a field,control or property name that Access can't find
2
3564
by: Steven Hayes | last post by:
Thanks for any help I'm new at this. I have the following excel statement: =IF(B131="", "Input UFMIP", IF((B131-B133)<0, 0, IF(B131>0, B131-B133, 0))) I tried unsuccessfully to convert to access: =iff(=" ","Input UFMIP", iif(-,0,0, iff(-,0))) I rec'd this error message:
1
12147
by: Steven Hayes | last post by:
I am trying to convert this excel expression into an Access expression: =IF(OR(B79="",B62="", H7=""),"Required Fields Incomplete",IF(AND(F87<20000,OR(J87>P14, B87>P37)),"Yes, this is a HIGH COST loan. Proceed to Step 5 Excluded Fees Test.",IF(AND(F87>=20000,J87>P12),"Yes, this is a HIGH COST loan.","No, this is NOT a High Cost loan"))) I've converted the cell numbers to field names, however I am unable to overcome the error message: "The...
0
9595
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10008
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,...
0
9873
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6682
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
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...
1
3974
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 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.