R
rdonges
Is it not possible to reference the value of a control on a form for the
criteria in a Dcount function? The example in Access' help don't state this
explicitly. If you can only use constants as the criteria in Dcount, then
its usefulness is extremely limited. Here's what I'm trying to do, and it
only returns "0" no matter how many records match the criteria:
Dim numPermits As Integer
numPermits = DCount("[MemberID]", "tblPermits", "[MemberID] =
'frmPermitsMain!cboMemberID.Value'")
The fact that all I get is zeros tells me Dcount thinks my criterion is a
constant, and it isn't even looking at the combo box. Is it possible to use
a reference to a control or to use a variable for the criteria in Dcount?
Any answers or suggestions are greatly appreciated.
Randy Donges
criteria in a Dcount function? The example in Access' help don't state this
explicitly. If you can only use constants as the criteria in Dcount, then
its usefulness is extremely limited. Here's what I'm trying to do, and it
only returns "0" no matter how many records match the criteria:
Dim numPermits As Integer
numPermits = DCount("[MemberID]", "tblPermits", "[MemberID] =
'frmPermitsMain!cboMemberID.Value'")
The fact that all I get is zeros tells me Dcount thinks my criterion is a
constant, and it isn't even looking at the combo box. Is it possible to use
a reference to a control or to use a variable for the criteria in Dcount?
Any answers or suggestions are greatly appreciated.
Randy Donges