Solved

How to create a vba code to change checkbox value to TRUE in access for all records in a query?

Posted on 2015-02-24
2
838 Views
Last Modified: 2016-02-10
I have a form called “frmDailyReport”.  When I select an assignment group from the dropdown menu and run the report, I want to tag all of the records in the report as been sent.  I want to accomplish this by changing the value for the checkbox in the “Site Notified” field to “Yes” in the Audit Data table.  Please see the attached sample DB.

qryAuditsComplete:  Query to select all records that have been audited; Uses the frmDailyReport for criteria

qrySiteGroupList:  Query for dropdown list for the frmDailyReport

frmDailyReport:  Input for qryAuditsComplete
Sample.accdb
0
Comment
Question by:kbay808
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40629886
create a query like this

Update [Audit Data]
Set [Site Notified]=-1
Where [Assignment Group]=[forms]![frmDailyReport]![SiteGroupInput]

save the query as qryUpdate  and call it in the macro after opening the report

in VBA

see the codes behind the button Run Report VBA

see attached db
Sample.accdb
0
 

Author Closing Comment

by:kbay808
ID: 40629898
Thank you very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now