Hi,
I have the following code on my form which works as desired:
Private Sub Form_Open(Cancel As Integer)
qrycounter = 0
Counter_txt = qrycounter
qrycounter = DCount("[Logid]", "tbllog", "[tbllog].[sitesid] = [forms]![frmsites]![sitesid]")
Counter_txt = qrycounter
End Sub...