
How to knowing when a query is done
How do you tell when a query operation (using JET) is done? If it was an
asynchronous DAO operation you can check the StillExecuting property. But I
can not find a way to do this.
All I am trying to do is use COUNT(*) to return the number of rows that are
in a query. If I step through the code it works fine but if I run it the
value is not return. Here is the code:
Private Sub cmdCount_Click()
Dim nCount As Long
With Me
.RecordSource = "ABJRAR"
.RecordsetType = 2
.Filter = "rday >= #01/01/89# and rday <= #01/31/89#"
.FilterOn = True
End With
txtMonth.ControlSource = "= Count(*)"
nCount = txtMonth
txtMonth.SetFocus
txtMonth.ControlSource = ""
txtMonth.Text = nCount
End Sub
If someone could tell me how to save the result of executing a count query
into a variable then I would not have to do any of the gyrations above.
Specifically if I issue the count query:
SELECT COUNT(*) FROM ABJRAR
How do I save the result into a variable?