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

Home Posts Topics Members FAQ

"Select all" in IIF-function

Does anybody have any advice on selecting all records within a
iif-statement?

I have a form in which one has to state if all projects or just a
selection of projects are to be used for a query. If "all projects" are
required the query should show all records.
In the example below the iif-statement should select all projects or
just "projectnum ber 2".

I tried the following as criteria but none is working:

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",Is
Null,"projectnu mber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",like
"*","projectnum ber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all
projects",*,"pr ojectnumber 2")

Any suggestions on this?

Thanks in advance,
Rene

Sep 14 '06 #1
2 5869
This should work

Like IIf([Forms]![F_Quantities]![ProjSelOrAll]="all
projects","*"," projectnumber 2")

<bh****@hotmail .comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Does anybody have any advice on selecting all records within a
iif-statement?

I have a form in which one has to state if all projects or just a
selection of projects are to be used for a query. If "all projects" are
required the query should show all records.
In the example below the iif-statement should select all projects or
just "projectnum ber 2".

I tried the following as criteria but none is working:

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",Is
Null,"projectnu mber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",like
"*","projectnum ber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all
projects",*,"pr ojectnumber 2")

Any suggestions on this?

Thanks in advance,
Rene


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 14 '06 #2
Hi Martin,

It's working! Thanks a lot!

Cheers,
Rene
Martin schreef:
This should work

Like IIf([Forms]![F_Quantities]![ProjSelOrAll]="all
projects","*"," projectnumber 2")

<bh****@hotmail .comwrote in message
news:11******** **************@ h48g2000cwc.goo glegroups.com.. .
Does anybody have any advice on selecting all records within a
iif-statement?

I have a form in which one has to state if all projects or just a
selection of projects are to be used for a query. If "all projects" are
required the query should show all records.
In the example below the iif-statement should select all projects or
just "projectnum ber 2".

I tried the following as criteria but none is working:

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",Is
Null,"projectnu mber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all projects",like
"*","projectnum ber 2")

IIf([Forms]![F_Quantities]![ProjSelOrAll]="all
projects",*,"pr ojectnumber 2")

Any suggestions on this?

Thanks in advance,
Rene

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 15 '06 #3

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

Similar topics

3
2910
by: Phil Powell | last post by:
$sql = 'INSERT INTO fs_usermetadata (' . substr(trim($cols), 0, strrpos(trim($cols), ',')) . ') VALUES (' . substr(trim($values), 0, strrpos(trim($values), ',')) . ')'; if (!mysql_query($sql)) { $hasSubmittedUser = 0; $errorMsg .= $font . '<font color=cc0000><li>Could not insert record into db</li></font>' . '</font><p>';
23
5685
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've reduced my form request to a simple text string entry, instead of my desired optional parameters. As i have been stuck with a single unfathomable glitch for over a year. Basically, if i enter queries such as ; "select * from table" "select * from...
10
5637
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures changed to be like:
1
4178
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a couple of tables in my database using INNER JOINS and the WHERE clause to specify the required constraints. However, I also want to read two fields from a *single* record from a table called 'Locations' and then apply one of these field's values...
3
2141
by: Not Me | last post by:
Hi, Is there any criteria I can use in my where clause to say 'anything'? Maybe like the _ used in some languages? For my example, I want to use an inline-if, so if a checkbox is ticked I say where field=true, otherwise just let everything pass through. For checkboxes I know I can used iif(xxx,true,(true or false)) but I also wish to use strings, where iif(xxx,yyy,'*') doesn't work - as the search on
6
9352
by: GSteven | last post by:
(as formerly posted to microsoft.public.access.forms with no result) I've created a continuous form which is based on a straightforward table (ex - customers - 100 records). On the form there is a checkbox with a control source named "MARK" (boolean) from customer table. I can check and uncheck individual records fine. Then I created 2 command buttons named "Select All" and "Deselect All". The Onclick property of these buttons runs code...
2
3039
by: google | last post by:
Hello everyone, I am having an issue using the "Multi Select" option in a list box in MS Access 2003. I am making a form that users can fill out to add an issue to the database. Each issue can be associated with multiple categories. I have an "Issue," "IssueCategory," and "Category" in the database (among other tables). The form has a subform in it which is tied to the "IssueCategory" table. The main form is tied to the "Issue"...
5
7612
by: Lennart | last post by:
I really like the construction: select * from new table (update ....) X but I noticed that it cant be used as: insert into T select * from new table (update ....) X because of:
7
2935
by: php_mysql_beginer911 | last post by:
Hi .. hope someone will help i am trying to figure it out why i cannot post string "union select" every time i try to post data which content union and select .. the page doesn't get posted and it shows error page not found on this server i googled and found some people use union and select to hack sites (mysql injection) i guess the server i am using has some kind of filter and if a post string content "union select" ... it simply...
1
2504
by: StuartD | last post by:
I have a sub form that is populated based on the selection of a year from a combo box on the main form. I'm trying to add a second main form combo box for item category to further filter the sub form; however, I'd like the item category combo box to be interpreted as "all values" if no selection is made. I've tried using an IIf statement in the underlying query of the sub form to either use the value of the item category combo box if it has a...
0
9618
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
9454
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
10259
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
9906
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
6710
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
5354
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...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.