Run A Query When A Checkbox Is Checked

N

Nick hfrupn

I would like to run a query when a checkbox is checked but if I un-check the
box the query does not run.

Any help will be appreciated.

Regards
Nick
 
A

Al Camp

Nick,
Use the AfterUpdate event of the checkbox...
If YourChkBoxName = True the
'run query here
End if
 
N

Nick hfrupn

Thanks for your help Al.
I used Private Sub D_AfterUpdate()
If D = True Then
run query qyCompleteContinuations
End If
End Sub
However I couldn't get it to work and I also tried
DoCmd.OpenQuery qyCompleteContinuations

I am obviously doing something basically wrong?
 
A

Al Camp

Nick,
However I couldn't get it to work...
I'm surprised you didn't get some error message. Always include any error messages
when posting...

You should be using...
DoCmd.OpenQuery "qyCompleteContinuations"
or...
DoCmd.RunSQL "....The SQL string of your qyCompleteContinuations here......"
 
Top