473,396 Members | 1,929 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.

Checking the values of all records in a query

Seth Schrock
2,965 Expert 2GB
I have a query that returns a check box that tells me if a task has been completed. What I'm trying to do is have some code that will mark the job completed once all of the tasks are completed. My problem is that I don't know how to check if all the check boxes are true in the query. Here is the query:

Expand|Select|Wrap|Line Numbers
  1. SELECT tblDeviceTask.Completed
  2. FROM tblJob INNER JOIN 
  3. (tblTask INNER JOIN tblDeviceTask ON tblTask.TaskID = tblDeviceTask.TaskID) 
  4. ON tblJob.JobID = tblTask.JobID
  5. WHERE (((tblDeviceTask.[DeviceNumber])=[Forms]![frmJobCompletion]![sfrmDeviceJob_Completion]![DeviceNumber]) 
  6. AND ((tblJob.JobID)=[Forms]![frmJobCompletion]![cboJobName]));
  7.  
Is it possible to just test if the query is True? Or do I have to loop through all of the records testing the value each time and if so, how?
Sep 12 '12 #1
4 1546
TheSmileyCoder
2,322 Expert Mod 2GB
You could use an aggregate query and count the records where Completed is false. If the count>0 then the job is not complete.
Sep 12 '12 #2
Seth Schrock
2,965 Expert 2GB
I just tried using the Count when three records were false and the count was zero. Is it counting the values of the checkbox (ie. 0 and 1)?
Sep 12 '12 #3
Seth Schrock
2,965 Expert 2GB
I just tried the count on the query without having the false criteria. There were 8 records returned: 5 checked and 3 unchecked. The count was 5. Should I compare the Count value with the record count and if the same, then job is complete?
Sep 12 '12 #4
Seth Schrock
2,965 Expert 2GB
I figured out a way to do it. I reset the criteria to have Completed = False (if all the tasks are completed, then the query will be empty). I then did a DCount in my VBA function which counts the records in the query. If the value is 0, then the job is completed. This does work, but would it be better to do it another way?
Sep 12 '12 #5

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

Similar topics

2
by: Jason | last post by:
I have a table of 650,000 records associated to contracts. Some of the contracts have multiple records but each contract only has one Active Record (there might be several inactive records). ...
5
by: Randy Harris | last post by:
How can I report an average of non zero values? If the values are: 5, 0, 6, 0, 4 I would like the result 5 (15 / 3), not 3 (15 / 5) Thanks for any help...
1
by: John M | last post by:
Hi, I have two incomplete lists of staff which combined create a full list of staff with duplicates. I wish to create a full list with no duplicates. Each member of staff has and obviously a...
1
by: Maxi | last post by:
I have two tables "Data" and "Check" Here is the content of the tables: "Data" "Check" Field1 Field1 Field2 Jack Jill Yes Jill Maxi Yes Dino John ...
2
by: bhavik | last post by:
hi i want to know how to hide the values in query string in ASP.net. here i want to send the values from one page to another page through query string with out explicitly visible the values in...
7
by: J-P-W | last post by:
Hi, in the past I've spent ages writing VB routines to get around this problem, is there a simple way? I have three tables for a membership system: tblMembership - MembershipNumber; Names etc...
8
by: Josetta | last post by:
Hopefully, I can explain what I want to do and hopefully, one of you can point me in the right direction. Here goes: I have a table with a bunch of companies (hundreds). They all perform...
5
by: ernestb08 | last post by:
I have a Customers Table with the following field names. C_FirstName C_LastName C_MiddleI .. .. .. .. ..
1
by: RZ15 | last post by:
Hi, I have a form that opens a report. The form allows the user to pick a particular warehouse or supplier and an order to sort by. Here is the code for it: Private Sub cmdOK_Click() ...
4
by: abdul razak | last post by:
delete multiple records by checking checkboxes records from database use javascript
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
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
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...

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.