kamamakazii
04-13-2008, 06:20 AM
Is it possible to run a query when a check box is pressed? If it is possible how would i then go about comparing the result. I would like it so that a count query is run when the check box is pressed and then if the result is 20 or greater then a command button is disabled. Any help?
ajetrumpet
04-13-2008, 09:48 AM
open the query's recordset, perform the count, and disable the button based on the result.
boblarson
04-13-2008, 02:00 PM
Or do a DLookup using the Query as the table and disable:
If DLookup("TheCountFieldNameInTheQuery","TheQueryNameHere") >=20 Then
Me.YourCommandButtonNameHere.Enabled = False
Else
Me.YourCommandButtonNameHere.Enabled = True
End If