Access query to click checkbox once complete

Posted on 2013-09-16
Medium Priority
Last Modified: 2013-09-16
Hi All,

I have an access dashboard that run about 8 queries.  When a user clicks on each button to run each query, I'd like a checkbox to be checked once the query completes.  The reason is because some of the queries take a long time to complete.  Or if anyone has another suggestion on showing the progress of each query I'd appreciate it.  


Question by:Anthony6890
LVL 50

Expert Comment

by:Dale Fye
ID: 39496291
I'm working from my iPad, so cannot pull up any code examples, so I don't have values for the appropriate error codes that might be generated during these queries.

Are the checkboxes bound to fields in a table, or unbound.  Generally I use code similar to:
Private Sub cmd_ProcessQueries_Click

    Dim db as DAO.database
    Dim bComplete as boolean

    On Error Goto ProcError

    set db = currentdb

    bComplete = true
    db.execute "Query1", dbfailonerror
    me.chk_Query1 = bComplete

    bComplete = true
    db.execute "Query2", dbfailonerror
    me.chk_Query2 = bComplete

    bComplete = true
    db.execute "Query3", dbfailonerror
    me.chk_Query3 = bComplete

    On Error Resume next
    set db = nothing
    Exit Sub
    Select Case Err.Number
        Case  X, Y, Z  'insert error codes
            bComplete = False
            Resume Next
        Case Else
            msgbox err.number & vbcrlf & err.description, vbOkOnly
            Resume ProcExit
    End Select

End Sub

Open in new window

This particular error handling would allow successive queries to process even though a previous query did not process properly.  You might want to modify that logic.
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 39496296
you can use a label place besides each command button.

set the following properties of the label
visible NO
fontname Wingdings

in click event of the button, place codes like this

private sub btn_click()

'run your query here

'show the check mark

end sub

Author Comment

ID: 39496335
Thank you both.

Capricorn, I went with your suggestion, it worked very well.

Thank you!!!

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

624 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