473,325 Members | 2,342 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.

Need a report checkbox which shows a check from any of 3 table fields

I have three check boxes in a table which I would like tracked in a report check box showing a check mark if any one of the three fields has a positive value. For arguments sake the three fields in the table can be called: check1, check2 and check3. The report check box will only be clear (no check) if all 3 table check boxes are empty or clear. Is it possible to have this within a report? If not, how can it be handled so that it displays within a report and what logical code is required in the tracking check box?
Apr 21 '12 #1

✓ answered by NeoPa

Your question is so ambiguous that an appropriate answer is hard to find.

If you're dealing with boolean fields (True or False values only) then :
Expand|Select|Wrap|Line Numbers
  1. SELECT ([Check1] AND [Check2] AND [Check3]) AS [ReportCheck]
If you are actually referring to numeric fields as part of your question implies, and you really want to check for positive numbers rather than simply checking for True values, then :
Expand|Select|Wrap|Line Numbers
  1. SELECT (([Check1] > 0) AND ([Check2] > 0) AND ([Check3] > 0)) AS [ReportCheck]
Please try to make your questions make clearer sense in future.

10 1645
nico5038
3,080 Expert 2GB
Just add a column to a query based on the table like:
Expand|Select|Wrap|Line Numbers
  1. select field1, field2, IIF(check1=true or check2=true or check3= true,true,false)
  2.  
And use that for the report.
Getting the idea?

Nic;o)
Apr 21 '12 #2
NeoPa
32,556 Expert Mod 16PB
Your question is so ambiguous that an appropriate answer is hard to find.

If you're dealing with boolean fields (True or False values only) then :
Expand|Select|Wrap|Line Numbers
  1. SELECT ([Check1] AND [Check2] AND [Check3]) AS [ReportCheck]
If you are actually referring to numeric fields as part of your question implies, and you really want to check for positive numbers rather than simply checking for True values, then :
Expand|Select|Wrap|Line Numbers
  1. SELECT (([Check1] > 0) AND ([Check2] > 0) AND ([Check3] > 0)) AS [ReportCheck]
Please try to make your questions make clearer sense in future.
Apr 21 '12 #3
Sorry, here is an elaboration on the particulars of my request.

1. I have a table, called DRM
2. In the table are three checkbox fields called EV1, EV2 and EV3
3. I need to show whether any of the three are true in a checkbox field in a report as space is limited to print horizontally and I only need to see if any one of the three are true or none are true, meaning false (yes = any one field is checked, or no = none of the fields are checked)
4. Is there a way to show a new check box field which checks the other three fields in the table and returns a yes or no (checked or not) depending on the values of the table fields as described above?
Apr 23 '12 #4
Rabbit
12,516 Expert Mod 8TB
You can use NeoPa's first method, just change the ANDs to ORs.
Apr 23 '12 #5
NeoPa
32,556 Expert Mod 16PB
Rabbit is right on the money. To illustrate, and include the information you have included now (Good move BTW. Better in the first post generally, but learning is always good) :
Expand|Select|Wrap|Line Numbers
  1. SELECT ([EV1] OR [EV2] OR [EV3]) AS [AnyEV]
  2. FROM   [DRM]
Apr 23 '12 #6
I have the code which works given the situation I have in the table as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT IIf(PCBanner='Yes' Or PCColumn='Yes' Or PCColumn='Yes' Or PCFootprints='Yes' Or PCPoster='Yes' Or PCOther='Yes','Yes','No') AS PC
  2. FROM CRF;
This works as a query, however, I have been unsuccessful in having this code work as the source for a new field within the report.

Excuse my ignorance; what is the correct place for this code to work as the source of a new field in the report?

Or... can the query be the source of a field in the report?

Almost there...
Apr 24 '12 #7
NeoPa
32,556 Expert Mod 16PB
Now you're confusing me. This is not consistent with your original question, so it's hard to know which information is accurate.

If this latest post is accurate then you are dealing with Text values and not Boolean ones as would be expected when using a CheckBox control. You also asked originally for code to check if the values were positive. That's a question that makes little sense when dealing with Booleans, but assuming your grasp of Booleans is slim, as most people's are, then understandable. If the values are 'Yes' or 'No' (Text values) then I can't see how anyone could ask such a question. It's beyond meaningless. Hence, with all this info to go on, the only conclusion I can reach is that you don't seem to know what you're dealing with. Not an easy starting position when setting about trying to answer a question.

For now though, if you have a working query then I'll leave that with you.

Lucrecious:
can the query be the source of a field in the report?
This bit makes sense at least. Yes. You can create a field in your query, just as you have here, and use that field in your report.
Apr 24 '12 #8
Thanks NeoPa, and so how does one include the field from the query in a report? The query does work, thank you for the sample code which I based the query upon in order to get it to work, however, I don't know how to create the field with the query results as the source.
Apr 24 '12 #9
NeoPa
32,556 Expert Mod 16PB
That's just confusing. Is your report bound to the query? Obviously it must be for this to make sense, yet from your question it seems maybe it isn't.

If it is, then it's simply like using any other of the fields of the query. If it isn't then you may need to look at this again from scratch, and maybe learn some of the very basics before trying to use Access.
Apr 25 '12 #10
NeoPa, I figured it out, and, thank you.
Apr 25 '12 #11

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

Similar topics

0
by: Sigurd Urdahl | last post by:
I need to do CHECK TABLE on a lot of tables (actually on all tables in several databases), and hoped to do something like mysql> CHECK TABLE reports.* which ddn't work. The only thing that...
4
by: LRW | last post by:
Very basic, very simple, but I can't get a checkbox to check when the value of a text field changes to something greater than 0. Here's what I have: THE JAVASCRIPT: <script...
4
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". ...
3
by: DStark | last post by:
Hi! Is it possible to iterate through table fields in an ADP? What I'd like to do is: Sub PrintTableFields() Dim dbs As Object Dim tbl As AccessObject Dim fld As ???? Set dbs =...
12
by: Orchid | last post by:
Hello all, I have different version of reports which used for different months. For example, I am using report version 1 up to September, but we have some design changes on the report for October,...
1
by: tom_8872 | last post by:
Need a Logo Design? Check out this Company! They made my logo for only $19.95! Though you might want to check it out. Here is the link:...
1
by: Dale | last post by:
Access 2003 I am trying to figure out how to develop a report that will display students in 1st column, dates across the top, and "P" or "A" for the data. I have a crosstab that displays what I...
37
by: viki1967 | last post by:
Hi all. I have this simple form. I need if checkbox C_1 is selected: 1) field name="n_1" is required and accept only numbers; 2) field name="n_2" is required and accept only numbers; I...
7
by: ismailc | last post by:
Good day, I urgently need help. I need to check all fields have values on click of button. The button already has a command but i need to check / run through the page for required fields. ...
1
by: Vicente | last post by:
The form fields are bound correctly to corresponding table fields. This is a simple table with a simple form (3 fields)
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.