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
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
Thanks, but I don't have a Query for the Report.
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 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. - CheckboxName.Visible = CheckboxName
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.
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?
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. - CheckboxName.Visible = CheckboxName
Where is the On Render event?
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!)
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.
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.
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.
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?
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.
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).
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: - SELECT [Registration Number],[Address],[Builder],[PO#],
-
[Model],[Expected Completion Date],[Registration Date],
-
[Heated Ceiling (w/attic)],[Heated Ceiling (w/o attic)],
-
[Exterior Walls],[Basement Walls],[Overhanging Floors],
-
[Ventilation],[Duct Sealing],[Fireplace],[Windows1],
-
[Windows2],[Windows3],[Windows4],[Patio Doors],[Heating],
-
[Water Heating],[Air Leakage],[ECM motor in the furnace],
-
[ECM motors in HRV],[Compact fluorescent lamps],
-
[Fluorescent fixtures],[Motion sensors on lights],
-
[Outdoor lighting photoboltaic cells],
-
[Energy Star refrigerator],[Energy Star dishwasher],
-
[Energy Star clothes washer],[Energy Star AC],
-
[Low flush toilets],[Dual flush toilets],
-
[Low flow shower heads],[Insulate hot water lines],
-
[Front loading clothes washer]
-
FROM [Builder Option Package]
-
WHERE ((([ECM motor in the furnace])=True)
-
AND (([ECM motors in HRV])=True)
-
AND (([Compact fluorescent lamps])=True)
-
AND (([Fluorescent fixtures])=True)
-
AND (([Motion sensors on lights])=True)
-
AND (([Outdoor lighting photoboltaic cells])=True)
-
AND (([Energy Star refrigerator])=True)
-
AND (([Energy Star dishwasher])=True)
-
AND (([Energy Star clothes washer])=True)
-
AND (([Energy Star AC])=True)
-
AND (([Low flush toilets])=True)
-
AND (([Dual flush toilets])=True)
-
AND (([Low flow shower heads])=True)
-
AND (([Insulate hot water lines])=True)
-
AND (([Front loading clothes washer])=True));
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?
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.
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.
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.
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.
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: -
Name Chkbox1 Chkbox2
-
Bob Yes No
-
Tim No Yes
-
Kim No No
-
Eva Yes Yes
-
-
Then the report you want is:
-
Bob Chkbox1
-
Tim Chkbox2
-
Kim
-
Eva Chkbox1 Chkbox2
-
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.
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: -
Name Chkbox1 Chkbox2
-
Bob Yes No
-
Tim No Yes
-
Kim No No
-
Eva Yes Yes
-
-
Then the report you want is:
-
Bob Chkbox1
-
Tim Chkbox2
-
Kim
-
Eva Chkbox1 Chkbox2
-
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.
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...
Yes, which was exactly what I suggested in the beginning...
Yes you did. Somehow I got off on another tangent.
Thanks again
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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++)...
|
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...
|
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...
|
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...
| |
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...
|
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....
|
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....
|
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...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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,...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
|
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...
| |