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

yes/no field on report used to filter a query

64 64KB
Hi,

Ik have a form on which the user can fillin a few field that are used to filter a query to make a report.

On the form is also a button to run the report in preview mode.

The fields used are usually drop down lists from which the user then selects one item.

The query criterium is then:

Like [Forms]![frm_rapporten].[cmb_rap_am] & "*"

This line i use to filter the report and if the user did not choose an item from the combobox [cmb_rap_am] it will not filter on thsi field.

Now, i also have a yes/no field on the form.

If the yes/no box is checked i would like all records where this field is set to "Yes" to be EXcluded from the recordset.

If the yes/no box is not checked, there should not be a filter set on this field.

Does anybody know how to achieve this in te criterium part of a query ?

Any help would be greatly appreciated !
Thanks,
Pierre
Mar 27 '13 #1

✓ answered by Rabbit

Return it if the field is not the checkbox value or the checkbox is false. That way, if the checkbox is true, it will return the false. Otherwise, it returns everything.
Expand|Select|Wrap|Line Numbers
  1. fieldName = Not checkbox Or checkbox = False

4 6044
MikeTheBike
639 Expert 512MB
Hi

A little difficult to illustrate without any field/control name but perhaps this may help

Expand|Select|Wrap|Line Numbers
  1. Like [Forms]![frm_rapporten].[cmb_rap_am] & "*" AND (CheckField = False OR CheckField <> CheckBox)
I think this will always show False (No) Recods and only the True (yes) records whan the Checkbox is False (ie only filter 'Yes' records whan checked).

I think.

MTB
Mar 27 '13 #2
Pierkes
64 64KB
Hi MTB,

Thanks for your reply. However, i don't think this will work for me.

I have the following checkbox on the form;[yesno_rap_grl]

Every record in the query has a field called [grl] which can be true or false.

If the [yesno_rap_grl] is checked on the form, i want the query to list all records except the ones where "[grl] = true"

If the [yesno_rap_grl] is not checked on the form, i want the query to list alle the records including the records where the field [grl] is true or false

I hope this is more clear and you have a solution for me ?

Regards,
Pierre
Mar 27 '13 #3
Rabbit
12,516 Expert Mod 8TB
Return it if the field is not the checkbox value or the checkbox is false. That way, if the checkbox is true, it will return the false. Otherwise, it returns everything.
Expand|Select|Wrap|Line Numbers
  1. fieldName = Not checkbox Or checkbox = False
Mar 27 '13 #4
Pierkes
64 64KB
Thanks Rabbit !

Your solution works fine now !

Pierre
Apr 2 '13 #5

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

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
3
by: John Baker | last post by:
Hi: At the outset let me admit that I screwed up! I have built a rather elaborate set of forms and sub forms starting with a client table, and going down to PO and Line item. This works very...
18
by: simonmarkjones | last post by:
Hi all, I create a report to act as a receipt to customers. The report displays all the customer payment details and then i print this. This works fine. However, i now want to add some more...
1
by: OtheymAverian | last post by:
For the past few days I have been trying to figure out how to add a Ranking field to a sorted query so I can then reference the rank in a report. I am using Access 2002 and have no SQL experience,...
6
by: ontherun | last post by:
hi, i am a newbie in access and i created a database which is between client and job. the job fields consists of more than 100 fields. i could not split the fields as the relationship is 1-to1....
0
by: greg | last post by:
I'm doing a join on a table with a cross tab query and I only want to select the last field in the crosstab query but I get a syntax error, even if I reference it with the correct dynamically...
1
by: satheeshvelu | last post by:
I am new user used in crystal report. I have problem in how to fetch the database in crystal report used in Oracle Jdeveloper i have query regarding that in Java. And then how to connect the data...
8
by: Gari | last post by:
Hello, I am trying to build a filter query with some AND and OR. I have three text boxes and 5 check boxes. The checkboxes are linked via code to other textboxes for the purpose of the query. ...
5
by: Ian Brown | last post by:
Hi, this is my first post on this site, so my apologies if I have done this wrong. I'll also apologise for my spelling as I'm dyslexic. I'm having a problem with a Report from my database. I have...
11
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.