473,396 Members | 2,052 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,396 software developers and data experts.

I am having an issue with access 2007 iif expression.

I am trying to issert an iif expression in a query that looks at a field in another query. I need to have anything that is an "N" return a value of FALSE and anything that is "Y" return a value of TRUE.

Here is my expression:

Job Lot Layered with OSS: IIf([iqry00021 Add HOVBU]![JOBLOTLAYEREDWITHOSS]= ”N”, ”False”, ”True”)
Sep 28 '10 #1
2 1611
beacon
579 512MB
Hi J,

I would just include the expression in the [iqry00021 Add HOVBU] query itself as an extra field? That way every record identifies if it is "True" or "False" without having to mess with trying to refer to a separate query (which I don't think is possible).

Plus, by having the expression in the query where the other data resides, you can do other things in future queries, like sum the number of True's, without having to create other queries or expressions.
Sep 28 '10 #2
Stewart Ross
2,545 Expert Mod 2GB
Hi. There are two problems with your approach. Firstly, you cannot refer to a field within another query unless you either join that query to the existing one on some common field or fields, or you lookup its value using the DLookup function. Secondly, in an IIF the constants False and True are not enclosed in quotes.

You don't actually need the IIF in any case, since the test for the value being equal to "Y" already returns False or True as a result. Assuming that the query you want to look up is not already joined to the current one, your expression becomes something like:

Job Lot Layered with OSS: Nz(DLookup("[JOBLOTLAYEREDWITHOSS]", "[iqry00021 Add HOVBU]"), "N") = ”Y”

I have used Nz here to substitute "N" in the event that the field value is null, as this would otherwise cause a run-time error.

-Stewart

PS Beacon's post and mine crossed, but I agree with him entirely. It s always better if at all possible to include the fields you need by joining the queries properly.
Sep 28 '10 #3

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

Similar topics

49
by: Allen Browne | last post by:
If you are looking for opinon on what's useful in Access 2007, there's a new article at: http://allenbrowne.com/Access2007.html Covers what's good (useful features), what's mixed (good and bad),...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
2
by: ARC | last post by:
Just curious if anyone is having issues with Acc 2007 once the number of objects and complexity increases? I have a fairly large app, with many linked tables, 100's of forms, queries, reports, and...
1
by: rickcross | last post by:
I am trying to use the Access 2007 runtime. I have a program that is fully working in 2007 but when I install the runtime version with same Operating system and Access 2003 installed I have...
4
by: TheScullster | last post by:
Hi all This must have been covered already, but Google (or my use thereof) is failing me! We have a company database originally created in Access 2000. The backend is located on a Win2003...
8
by: elias.farah | last post by:
Hello Everyone, I'm having some very weird behavior on a couple of Access forms. (Not all forms, just some of them). The forms have been working for years, under Access XP/2003 etc, and last...
10
by: Arno R | last post by:
Hi all, So I bought a new laptop 10 days ago to test my apps with Vista. (home premium) Apparently Office 2007 is pre-installed. (a time limited but complete test version, no SP1) So I take the...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
1
by: kfry | last post by:
I am having an issue maybe someone can help with. I have written an application with Access 2003 on my XP pc. I then package it and install it on my VISTA Access 2007 PC. When I do this the wrong...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
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
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
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...

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.