Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
1,229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

719 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