473,480 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query No-Brainer

I must be having a bad day because this is so elementary. I have a
calculated field in a query:

Criteria: IIf([forms]![frmMain]![cboDiscipline]="All","All",[TASK_COMPLETE])

If I run the query without the form and enter the parameters manually it
works. If I run it with the form open then the field returns
[TASK_COMPLETE] regardless of the selection made using cboDiscipline.

cboDiscipline has a value list of All;Y as its row source.

I'm getting ready to slap my forehead ... what am I doing wrong?

Thanks.
Keith.

Jun 27 '08 #1
2 1103
Why don't you make a selection in the combobox
open a module and in the immediate window try
"? [forms]![frmMain]![cboDiscipline]" without the quotes
and then
"? [forms]![frmMain]![cboDiscipline] = "All" " with quotes only on the All

and see what the system thinks the expression evaluates to?
My guess would be that you have a different column bound to the cbo.
"Keith Wilby" <he**@there.comwrote in message
news:48**********@glkas0286.greenlnk.net...
>I must be having a bad day because this is so elementary. I have a
calculated field in a query:

Criteria:
IIf([forms]![frmMain]![cboDiscipline]="All","All",[TASK_COMPLETE])

If I run the query without the form and enter the parameters manually it
works. If I run it with the form open then the field returns
[TASK_COMPLETE] regardless of the selection made using cboDiscipline.

cboDiscipline has a value list of All;Y as its row source.

I'm getting ready to slap my forehead ... what am I doing wrong?

Thanks.
Keith.

Jun 27 '08 #2
"KC-Mass" <connearneyATcomcastDOTnetwrote in message
news:CY******************************@comcast.com. ..
Why don't you make a selection in the combobox
open a module and in the immediate window try
"? [forms]![frmMain]![cboDiscipline]" without the quotes
and then
"? [forms]![frmMain]![cboDiscipline] = "All" " with quotes only on the All

and see what the system thinks the expression evaluates to?
My guess would be that you have a different column bound to the cbo.
I realised my mistake about 5 seconds after pressing "send" and I
immediately cancelled my posting but it seems that I wasn't fast enough. I
had copied/pasted the calculated field from another query and forgotten to
change the cboName it was referring to (cbo's are unbound). Sorry to have
been any trouble and thanks for responding.

Regards,
Keith.

Jun 27 '08 #3

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

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
9
3103
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
3
5365
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
2
18681
by: Dom | last post by:
I need to run a query based on a query in Access. The second query has a number of conditions which all work well, but there is one more contition I need to set to make it run properly. the...
4
2306
by: John Baker | last post by:
Hi: Most of the time when I do a query and it has no matches, there is a single blank line in the result that I can test. I have one query where no result produces a response with NO lines at...
6
8132
by: Sven Pran | last post by:
Probably the answer is there just in front of me only awaiting me to discover it, but: 1: I want to build a query that returns all records in one table for which there is no successful "join"...
4
7729
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
5
2046
by: DeanL | last post by:
Hi all, I'm trying to set up a query that runs from a command button on a form (simple enough so far), what I want the query to do is take values from the fields on the form (seven fields in...
16
3457
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
4
3110
by: Stan | last post by:
I am using MS Office Access 2003 (11.5614). My basic question is can I run a query of a query datasheet. I want to use more that one criteria and can not get that query to work. I thought I...
0
7033
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
6903
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
7027
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
6861
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...
0
5318
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,...
0
2987
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...
0
2974
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1291
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 ...
1
557
muto222
php
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.