473,323 Members | 1,551 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,323 software developers and data experts.

IIF statement problems.

16
I need assitance with my IIF statement.

IIf([Reports]![RptMaster]![ChkBxs]="1",True,IIf([Reports]![RptMaster]![ChkBxs]="2",False,IIf([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 1840
gnawoncents
214 100+
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
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 100+
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
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, 85 views)
Nov 8 '10 #5
gnawoncents
214 100+
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, 76 views)
Nov 9 '10 #6

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

Similar topics

3
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...
2
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 ...
10
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
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...
2
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...
0
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...
4
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 ...
1
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...
2
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...
1
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.