473,480 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checkboxes in reports

14 New Member
Hi everyone,

I am fairly new to Access and have only set up simple databases. The database I am working on now has check boxes. In the Report I only want the check boxes that are checked off to show. How do I do that?

Thanks
Feb 2 '07 #1
25 3177
ADezii
8,834 Recognized Expert Expert
Hi everyone,

I am fairly new to Access and have only set up simple databases. The database I am working on now has check boxes. In the Report I only want the check boxes that are checked off to show. How do I do that?

Thanks
The easiest way would be to modify the criteria in the underlying Query for the Report by setting the Control Source for the Check Box = True
Feb 2 '07 #2
sunridge
14 New Member
Thanks, but I don't have a Query for the Report.
Feb 2 '07 #3
Tetelestai
34 New Member
You'll need to make a query. Then base the report on the query.


A starter way to make a query is to use the query wizard. You can include all the fields in your table in your query.

Open the query (made with the wizard) in design view, set the critera for the check box field to True
Feb 2 '07 #4
Rabbit
12,516 Recognized Expert Moderator MVP
I don't know if this will work for a report as I don't use reports much but in the On Render event. Select Event Procedure and put the following in the code.

Expand|Select|Wrap|Line Numbers
  1.  CheckboxName.Visible = CheckboxName 
Feb 2 '07 #5
sunridge
14 New Member
You'll need to make a query. Then base the report on the query.


A starter way to make a query is to use the query wizard. You can include all the fields in your table in your query.

Open the query (made with the wizard) in design view, set the critera for the check box field to True
I made the query as you said. But when I ran the Query the resulting table came up empty.
Feb 2 '07 #6
Rabbit
12,516 Recognized Expert Moderator MVP
Use ADezii's solution if you want the entire record to not be shown when the checkbox is unchecked.

Use my solution if you want only the checkbox to not be shown but to still display everything else.

Also, for the query that's coming up empty, what's the SQL?
Feb 2 '07 #7
sunridge
14 New Member
I don't know if this will work for a report as I don't use reports much but in the On Render event. Select Event Procedure and put the following in the code.

Expand|Select|Wrap|Line Numbers
  1.  CheckboxName.Visible = CheckboxName 
Where is the On Render event?
Feb 2 '07 #8
sunridge
14 New Member
Use ADezii's solution if you want the entire record to not be shown when the checkbox is unchecked.

Use my solution if you want only the checkbox to not be shown but to still display everything else.

Also, for the query that's coming up empty, what's the SQL?
I want the entire record to not be shown so I will use ADezii's solution.
I entered True into the Criteria of the checkboxes (in Design View) and then ran the Query. The resulting table was empty. I'm sorry, I don't know what SQL is (I guess I have some learning to do!)
Feb 2 '07 #9
Rabbit
12,516 Recognized Expert Moderator MVP
Oops, my bad, I ment On Format

In the report design view, right-click the bar that says detail and select properties. Click on the Event tab. The On Format event is located there.

Click the little box with the three dots on the right of the Event Procedure text box. Choose Code Builder from the popup box. Put the code in there. Adjusting for your name of your checkbox of course.
Feb 2 '07 #10
sunridge
14 New Member
The easiest way would be to modify the criteria in the underlying Query for the Report by setting the Control Source for the Check Box = True
I'm afraid I'm totally lost. I made a Query using the wizard and then went into Design View. I can't find a Control Source here only Criteria.
Feb 2 '07 #11
Rabbit
12,516 Recognized Expert Moderator MVP
In the criteria for the checkbox type True.

In the Design View of the query, right click the title bar and select SQL View.
Paste what's in there.
Feb 2 '07 #12
sunridge
14 New Member
In the criteria for the checkbox type True.

In the Design View of the query, right click the title bar and select SQL View.
Paste what's in there.
I have several check boxes so I have typed True into the Criteria section of each one. Then I go into SQL View and copy all that's in there? Where do I paste it?
Feb 2 '07 #13
Rabbit
12,516 Recognized Expert Moderator MVP
You said the query was coming up empty?

Paste it in here so we can take a look at it. Enclose it in Code tags.
Feb 2 '07 #14
NeoPa
32,556 Recognized Expert Moderator MVP
I think the results of the query come up empty.
The SQL we have yet to see.
Can you also post what was being used as the Record Source of the report before it was changed to the query.
Also, names of items will help with communication on these forums. Otherwise it's easy to get confused between different items (Query; Report; Form etc).
Feb 4 '07 #15
sunridge
14 New Member
You said the query was coming up empty?

Paste it in here so we can take a look at it. Enclose it in Code tags.
Here it is:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Registration Number],[Address],[Builder],[PO#],
  2.        [Model],[Expected Completion Date],[Registration Date],
  3.        [Heated Ceiling (w/attic)],[Heated Ceiling (w/o attic)],
  4.        [Exterior Walls],[Basement Walls],[Overhanging Floors],
  5.        [Ventilation],[Duct Sealing],[Fireplace],[Windows1],
  6.        [Windows2],[Windows3],[Windows4],[Patio Doors],[Heating],
  7.        [Water Heating],[Air Leakage],[ECM motor in the furnace],
  8.        [ECM motors in HRV],[Compact fluorescent lamps],
  9.        [Fluorescent fixtures],[Motion sensors on lights],
  10.        [Outdoor lighting photoboltaic cells],
  11.        [Energy Star refrigerator],[Energy Star dishwasher],
  12.        [Energy Star clothes washer],[Energy Star AC],
  13.        [Low flush toilets],[Dual flush toilets],
  14.        [Low flow shower heads],[Insulate hot water lines],
  15.        [Front loading clothes washer]
  16. FROM [Builder Option Package]
  17. WHERE ((([ECM motor in the furnace])=True)
  18.   AND (([ECM motors in HRV])=True)
  19.   AND (([Compact fluorescent lamps])=True)
  20.   AND (([Fluorescent fixtures])=True)
  21.   AND (([Motion sensors on lights])=True)
  22.   AND (([Outdoor lighting photoboltaic cells])=True)
  23.   AND (([Energy Star refrigerator])=True)
  24.   AND (([Energy Star dishwasher])=True)
  25.   AND (([Energy Star clothes washer])=True)
  26.   AND (([Energy Star AC])=True)
  27.   AND (([Low flush toilets])=True)
  28.   AND (([Dual flush toilets])=True)
  29.   AND (([Low flow shower heads])=True)
  30.   AND (([Insulate hot water lines])=True)
  31.   AND (([Front loading clothes washer])=True));
Feb 5 '07 #16
NeoPa
32,556 Recognized Expert Moderator MVP
Your SQL is saying "Show only those records where every boolean item is true." What (exactly) do you want it to say?
Feb 5 '07 #17
sunridge
14 New Member
Your SQL is saying "Show only those records where every boolean item is true." What (exactly) do you want it to say?
In the Report I only want the checkboxes that are checked off to show. I don't know how to say that in SQL.
Feb 5 '07 #18
Rabbit
12,516 Recognized Expert Moderator MVP
That's not what NeoPa meant.

As of right now, your SQL only selects the records where every checkbox is checked. This means that in your report, it will only show those records where every checkbox = True.

Is this what you want?

Or do you only need one checkbox to be checked to show up in the report.
Feb 5 '07 #19
NeoPa
32,556 Recognized Expert Moderator MVP
In the Report I only want the checkboxes that are checked off to show. I don't know how to say that in SQL.
As Rabbit said :
I don't want you to tell me in SQL. I want you to try to tell me in English. Nothing you've said so far indicates clearly what you want. I can translate into SQL, but only if I can make sense of the English first.
Think about ambiguity. Think about clear references. I'm not sure I know of any better way of expressing the request.

Bear in mind, a record has fields which may be boolean (or Yes/No) but a CheckBox is a control on a Form or Report which is sometimes used to display boolean data.
Sometimes simplified data examples can help to illustrate where the words are not available.
Feb 5 '07 #20
sunridge
14 New Member
As Rabbit said :
I don't want you to tell me in SQL. I want you to try to tell me in English. Nothing you've said so far indicates clearly what you want. I can translate into SQL, but only if I can make sense of the English first.
Think about ambiguity. Think about clear references. I'm not sure I know of any better way of expressing the request.

Bear in mind, a record has fields which may be boolean (or Yes/No) but a CheckBox is a control on a Form or Report which is sometimes used to display boolean data.
Sometimes simplified data examples can help to illustrate where the words are not available.
I want to produce a Report from a Table. The table has check boxes. In the report I only want to show the check boxes that are checked off. In other words I want to hide blank check boxes in the report. I was told to make a Query and indicate "True" in the Criteria section of the fields that are check boxes. From there I got totally lost.
Feb 5 '07 #21
Rabbit
12,516 Recognized Expert Moderator MVP
Ok, then use the code I posted earlier. You indicated earlier that you only wanted records to show if they had checkboxes checked. Which is why they pointed you towards using a query.

So, assuming your data looks like the following:
Expand|Select|Wrap|Line Numbers
  1. Name  Chkbox1  Chkbox2
  2. Bob     Yes         No
  3. Tim      No          Yes
  4. Kim     No           No
  5. Eva      Yes         Yes
  6.  
  7. Then the report you want is:
  8. Bob   Chkbox1
  9. Tim                   Chkbox2
  10. Kim
  11. Eva    Chkbox1  Chkbox2
  12.  
Uhh... misaligned but you get the idea.

Is this is what you're looking for, then use my code.

If not, then you'll have to explain more clearly.
Feb 5 '07 #22
sunridge
14 New Member
Ok, then use the code I posted earlier. You indicated earlier that you only wanted records to show if they had checkboxes checked. Which is why they pointed you towards using a query.

So, assuming your data looks like the following:
Expand|Select|Wrap|Line Numbers
  1. Name  Chkbox1  Chkbox2
  2. Bob     Yes         No
  3. Tim      No          Yes
  4. Kim     No           No
  5. Eva      Yes         Yes
  6.  
  7. Then the report you want is:
  8. Bob   Chkbox1
  9. Tim                   Chkbox2
  10. Kim
  11. Eva    Chkbox1  Chkbox2
  12.  
Uhh... misaligned but you get the idea.

Is this is what you're looking for, then use my code.

If not, then you'll have to explain more clearly.
I found something that works (in a Microsoft Office discussion group). In the Detail section of the Report (in design view) go to Properties and On Format. Put in the following code:
Me.checkbox1.Visible = Me.checkbox1
Me.checkbox2.Visible = Me.checkbox2
Me.checkbox3.Visible = Me.checkbox3

etc. etc.

It seems to work.

Thanks for your help and patience.
Feb 5 '07 #23
Rabbit
12,516 Recognized Expert Moderator MVP
I found something that works (in a Microsoft Office discussion group). In the Detail section of the Report (in design view) go to Properties and On Format. Put in the following code:
Me.checkbox1.Visible = Me.checkbox1
Me.checkbox2.Visible = Me.checkbox2
Me.checkbox3.Visible = Me.checkbox3

etc. etc.

It seems to work.

Thanks for your help and patience.
Yes, which was exactly what I suggested in the beginning...
Feb 5 '07 #24
sunridge
14 New Member
Yes, which was exactly what I suggested in the beginning...
Yes you did. Somehow I got off on another tangent.

Thanks again
Feb 5 '07 #25
NeoPa
32,556 Recognized Expert Moderator MVP
Well, I'm pleased you found the answer in the end. As Rabbit illustrates with his last post, it is to your own advantage (and simple courtesy) to read (and preferably reply to) all posts in your own thread(s). If there's something you don't understand then we can try to explain more clearly.
The important thing is you found your answer though.
Feb 5 '07 #26

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

Similar topics

2
3953
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is submitted (to page two), the values of the...
6
2832
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++)...
6
2231
by: BerkshireGuy | last post by:
I need to create a query that will filter out records based on records. There can be many combinations depending of what the uses selects. For instance: Field: Telemed - This is a Y or N...
0
1116
by: Jeff | last post by:
Help... I am developing a web page that uses checkboxes. The user checks the checkbox to select the data for the report. This information is stored in an SQL Server database. - No problem. I...
9
4355
by: Marc | last post by:
Okay, here's the problem - I have 3 radio buttons, and 11 check boxes (which are disabled by default). I have the javascript below which when the last radio button is clicked, enables the...
2
4445
by: Incolor | last post by:
Hello All! I have to generate a checklist form as an input form in Access. A paper form is taken out in the field and checked yes, no, OR n/a for each item inspected. The problem I am having is...
10
5177
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
7
5834
by: harikap | last post by:
hi , here im using vb.net 2005how can i add radiobuttons as column to windows datagridview control plz help me....
2
2797
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
4
13674
by: Yitzak | last post by:
Have a query that is arregated into crosstab query, it is working correctly. select Yes as selected from tblname or select true as selected from tblname Produces -1 ( vba value of True) in...
0
7044
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,...
0
6908
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...
0
7087
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...
1
6741
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...
0
6944
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...
0
5341
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,...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
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 ...
0
182
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...

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.