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

Checkboxes in reports

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 3174
ADezii
8,834 Expert 8TB
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
Thanks, but I don't have a Query for the Report.
Feb 2 '07 #3
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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 Expert Mod 16PB
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
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 Expert Mod 16PB
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
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 Expert Mod 8TB
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 Expert Mod 16PB
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
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 Expert Mod 8TB
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
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 Expert Mod 8TB
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
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 Expert Mod 16PB
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
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
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
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
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
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
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
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
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
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
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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,...
0
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
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
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...

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.