Access query to click checkbox once complete

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.  

Thanks.

-Anthony
LVL 1
Anthony6890Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeCommented:
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

ProcExit:
    On Error Resume next
    set db = nothing
    Exit Sub
ProcError:
    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.
0
Rey Obrero (Capricorn1)Commented:
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()
me.label1.visible=true
me.label1.caption=chr(81)
me.repaint

'run your query here


'show the check mark
me.label1.caption=chr(252)

end sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony6890Author Commented:
Thank you both.

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

Thank you!!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.