473,799 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

REQ: Help with querying check-boxes

dad
I am building a database to track the maintenance records on a fleet
of cars. I need to run a report on that will display data based on
whether a box is checked or not (i.e. all cars that have the oil
change box checked, or a report that shows all cars and lists all the
boxes that each have checked (for a list of maintennace due). Anyone
out there have any advice? Any would be appreciated. Thanks in
advance!
Mar 4 '06 #1
3 1508
Are you asking how to create a report based upon a query or how to do
the query in the first place?

Mar 4 '06 #2
If you are asking how to create the query (which I think you are),
perhaps the simplest way to go about this would be to select create a
new query, then use the simple query wizard which whill allow you to
select which table or query contains the records you are interested in.
It will then allow you to select the relevant fields to include in
your query. Be certain to include your check box fields. Next it will
ask you to name the query and gives you the option to modify the query
design, select this option.

You will then see a list of your fields. Find your check box fields
and in the corresponding row labeled "Criteria" In this row type "=
false" if you want the records that aren't checked or "= true" if you
want the records that are checked.

Save the query. Then you can use the report wizard to help you create
a nice looking report based upon this query.
I hope that helps.

Jody Blau

Mar 4 '06 #3
dad wrote:
I am building a database to track the maintenance records on a fleet
of cars. I need to run a report on that will display data based on
whether a box is checked or not (i.e. all cars that have the oil
change box checked, or a report that shows all cars and lists all the
boxes that each have checked (for a list of maintennace due). Anyone
out there have any advice? Any would be appreciated. Thanks in
advance!


When you open a report you can tell the report what you want to filter.
DoCmd.OpenRepor t "ReportName ", , , "WhereClauseFil ter"

In your case, most likely you call the report from a form. Let's call
the form RptFilter. Here you could present what you want to filter

Using your above example, you could have 2 lines; description & 2
checkboxes.

FilterField Filter? Yes/No?
Oil Change OCF Val1
Maint Due MDF Val2

The filter names are OCF/MDF as checkboxes. Val is a checkbox. Now if
you have a command button to print the report, first create a filter,
then call report

Dim strFilter As String
If Me.OCF Then strFilter = "OilChange = " & Me.Val1 & " And "
If Me.MDF Then strFilter = strFilter & _
"Maint Due = " & Me.Val2 & " And "
'remove And
If strFilter > "" Then strFilter = Left(strFilter, Len(strFilter)-5)
DoCmd.OpenRepor t "ReportName ", , , strFilter

This will open the report and filter as necessary.

I wouldn't bother filtering the report's recordsource SQL, do it from
the Where clause filter. This way you remain flexible.

I sometimes create a field to store a description of the filter.
Dim str As String
If Me.OCF Then str = "OilChange " & IIF(Me.Val1,"Y" ,"N") & space(4)
If Me.MDF Then str = str & ""Maint Due " & IIF(Me.Val1,"Y" ,"N")
Me.FilterStr = str

Now when I call the report, in the report header I have a field to
present the filter string. Let's say the form name is Rpt. The control
source of the text box to present the filter would be
="Filtered As " & Forms!Rpt!Filte rStr

That way the user knows, if he looks at the report later, what the
report was filtered on.




Mar 4 '06 #4

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

Similar topics

16
8103
by: siliconmike | last post by:
Hi, I'm looking for a reliable script that would connect to a host and somehow determine whether an email address is valid. since getmxrr() only gets the mx records.. Links/pointers ? Mike
2
6120
by: John F Dutcher | last post by:
Can anyone comment on why the code shown in the Python error is in some way incorrect...or is there a problem with Python on my hoster's site ?? The highlites don't seem to show here...but line #80 and line # 38 are the first line offenders. --> --> -->
8
1977
by: Sue | last post by:
Hello! I am back with another question. Remember I am a new JavaScript student and I am aware that this code does not check for all the possibilities and that as a "NEW" JavaScript student I am not expected to check for everything. At any rate, the problem I am having with the following code is that it does not clear the fields once I press the SEND button. So can anyone here enlighten me as to what is causing the problem.
8
1725
by: Sue | last post by:
In this code why is it that when I press the SUBMIT button the focus only goes back to the Numeric field. What do I need to do to correct this problem? Sue <html>
2
2634
by: Dan | last post by:
Hi all! I am creating a Disney "Today in History" database, and so far have about 300 entries in it. Well, my Access database is great, and my Frontpage form is great, but I want to include a short "On this date in Disney history....<event>" on my main web page. Basically, if someone goes to my web page, they'll automatically see this if there is an event that occurred on this day. So, my problem is... how do I create an SQL database...
2
5683
by: Peter O'Reilly | last post by:
I am experiencing difficulty access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists(), it fails to recognize a mapped network drive. This is true if the path specified uses a mapped drive letter or is expressed as a UNC address. I have also tried the drive letter and UNC paths with and without trailing backslashes, respectively.
8
3362
by: daD | last post by:
I'm trying to write a small database that tracks people coming and going from a small campground. I need to have the current guests in the "current" table" and then have the ability to check them out to the "archive" table when they leave, by pushing the "check-out" button. I see the steps as follows: 1. When the check-out button is pressed, the computer should automatically add the current date into the "date checked-out" field. ...
2
1742
by: RajSharma | last post by:
Hi, I am facing a problem regarding querying thru a large table having millions of rows....... Its hanging in between while querying for all those rows Can anybody suggest me a query regarding : Querying the database everytime for next 100 records ( that means i need to set up a cursor) till the count of the table rows ends up(take 1 million rows e.g.) The database is DB2
0
961
by: ......ADMISSION IN TOP 10 IIT's and ENGINNERING CO | last post by:
Req. Designation - Jr. Software Engineer(QA) Company - Allindia Technologies Limited. Criteria - Any Degree SALARY - 2.5 to 3.5 lakhs PA. How to apply -:
5
13387
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
9688
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
10491
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...
1
10247
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10031
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...
1
7571
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
5467
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
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.