473,769 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IIF statement problems.

16 New Member
I need assitance with my IIF statement.

IIf([Reports]![RptMaster]![ChkBxs]="1",True,II f([Reports]![RptMaster]![ChkBxs]="2",False,I If([Reports]![RptMaster]![ChkBxs]="3",,)))

I have a column in my table that stores values from a check box in my form.

I have a form that has a option group in it, and it has 3 buttons to select from. Depending on the value, you can get 1, 2 or 3 as your value; hence my IIF statement. Selection "1" will allow my report to filter my data for only checked boxes to display on my report. Selection "2" will allow my report to filter my data for only unchecked boxes to display on my report. Selection "3" is suppose to show all of them, but I am having dificulty with this. Can anyone help me figure this out?

Thanks in Advance.
Nov 4 '10 #1
5 1859
gnawoncents
214 New Member
Try this instead:

Expand|Select|Wrap|Line Numbers
  1. IIf([Reports]![RptMaster]![ChkBxs]="1",True,IIf([Reports]![RptMaster]![ChkBxs]="2",False,IIf([Reports]![RptMaster]![ChkBxs]="3","*",)))
Also, do you need the option for if nothing is selected? If not, you could go with:

Expand|Select|Wrap|Line Numbers
  1. IIf([Reports]![RptMaster]![ChkBxs]="1",True,IIf([Reports]![RptMaster]![ChkBxs]="2",False,"*"))
For either of these to work properly, you would need the criteria to evaluate to "[TableColumn] Like IIf..."

Let me know if you have any questions.
Nov 4 '10 #2
Mr Hero
16 New Member
Gnawoncents,

I tried both of your suggestions, the first one gave me a error message saying it was too complex. The other one nothing showed...
Nov 5 '10 #3
gnawoncents
214 New Member
Once you get the result from the IIF statement, how are you using it? Please be as specific as you can. That will give me a better idea of what you need.
Nov 5 '10 #4
Mr Hero
16 New Member
Okay, these are the steps:
1. When the Main report opens, it bring a form that has 2 fields for Dates, then There is a option group below the fields. (this is were I click to select what type of filtering is needed.)
2. Next, I click on the preview button which then opens my report.

I have attached a sample of the database.

Thanks again.

Mario
Attached Files
File Type: zip TestSample.zip (25.8 KB, 86 views)
Nov 8 '10 #5
gnawoncents
214 New Member
Okay,

I did my best to leave most of your coding intact. I modified some VBA and the SQL for a record source or two. Let me know if you have any questions.
Attached Files
File Type: zip TestSample1.zip (74.9 KB, 77 views)
Nov 9 '10 #6

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

Similar topics

3
1740
by: Mark Morton | last post by:
I'm writing an if statement for a UK credit card form validation script. Users who specify that their card is Switch need to enter either the issue number or the 'valid from' date. I'm trying to write an if statement so that if: 1. The word "Month" is in the validFromMonth field (where they haven't selected a month a the drop-down menu) or the word "Year" is in the validFromYear field (where they haven't selected a year another the...
2
1318
by: Jon | last post by:
Hi all I know this is not the preferred newsgroup, but you people are great with SQL MS ACCESS, VISUAL BASIC6 Hope you can see past my table, string definitions (Swedish), just ask otherwise Having some problem with a SQL statement I need to be able to run strSQL3, but I get an error about sum and that I
10
4294
by: Maksim Sipos | last post by:
Hello, I would like to have something like #ifdef VERSION_DEBUG #define DEBUG(x) DebugFnc(x) #end #ifdef VERSION_RELEASE #define DEBUG(x) <empty-statement> #end
21
2969
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have updated this system and changed the pages that are saved to the server as aspx - everything works fine and pages can be served - but Its not impossible for a single client to request 100 plus pages in one session - as each page is requested it is...
2
2745
by: Clark Endrizzi | last post by:
I just sent this twice before with the wrong email address so it didn't go through, that is why I am sending this so that it will get through. I hope this isn't causing issues. Hi guys. I certainly hope this is the correct place to email this. I'm having an issue that I have really tried to solve but can't. I'm using RHEL's postgresql 7.3.4 and everything works great except my to_char() statements. The most common conversion string...
0
1081
by: Clark Endrizzi | last post by:
Hi guys. I certainly hope this is the correct place to email this. I'm having an issue that I have really tried to solve but can't. I'm using RHEL's postgresql 7.3.4 and everything works great except my to_char() statements. The most common conversion string I use is 'MM/DD/YYYY HH:MM AM' which works except the minutes are never correct, they always end with ":04". So if I submitted it at 10:23 AM it will say 10:04 after conversion....
4
7639
by: Ivan | last post by:
Hi to all !!! And thanks to answer my topics. I have problems when I try of run stored procedures, show diferents errors. I made one test with one example of the tutorials. The example is this CREATE PROCEDURE RETURN_DEPT_SALARY (IN DEPT_NUMBER CHAR(3), OUT DEPT_SALARY DECIMAL(15,2), OUT DEPT_BONUS_CNT INT)
1
1588
by: patriciashoe | last post by:
Everything I read indicates the following statement should work. What happens is that any field after the where clause gets treated as a parameter by Access. Even if I supply the data the query fails. Any ideas? Thanks, Patti UPDATE teacherresources SET teacherresources.Strudent_enroll = strudent_enroll/(SELECT sum(enroll_data) FROM enrollment WHERE teacherresources.trSchool_id = enrollment.erSchool_id and year='2007-2008')*(SELECT...
2
1347
by: Lebbsy | last post by:
I have a datasheet form that on opening I want to select only the records whose Decision field value is "Recommend". I have the following SQL statement so far but it gives me the "cannot execute select query" error. strSQL = "SELECT IdentityNumber, Ministry, Surname, Designation, QualificationCategory, Qualification, SubmissionDate" _ & " FROM " _ & " WHERE = 'Recommend';" dbs.Execute (strSQL) Debug.Print strSQL...
1
1475
Fary4u
by: Fary4u | last post by:
Hi, I'm attempting to update a record via the recordset.update method, However, the recordset object is defined and accesses the correct record that I want to update, as I can retrieve field values from the record. The open string for the recordset that I'm using should allow changes: ors.open "Select * from products where productname='"&request("txtname")&"'",ocon1,Adopendynamic,Adlockoptimistic
0
9589
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
10047
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...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
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
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.