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
771 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

708 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

13 Experts available now in Live!

Get 1:1 Help Now