472,358 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 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 1560
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,511 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,511 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,511 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,511 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)
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.