I am trying to run a loop that will enable me to change the values of multiple text boxes. When I do a DCount/DLookup, I am getting a really weird problem. The part of the code I am having an issue with is below:
If IsDate(Me.Contr ols(DateName)) Then
DateL = D6Date
CritStr = "[Dt] = D6Date"
CritStr1 = "[Dt] = DateL"
MsgBox (DCount("*", "ManHoursQ" , CritStr))
MsgBox (DCount("*", "ManHoursQ" , CritStr1))
End If
----
So the first DCount gives me the correct answer. But the second DCount gives me the runtime error:
Run-time error '2471':
The expression you entered as a query parameter produced this error:'DateL'
-----
[Dt] is a Date field. Can anyone help me out? Thanks.
If IsDate(Me.Contr ols(DateName)) Then
DateL = D6Date
CritStr = "[Dt] = D6Date"
CritStr1 = "[Dt] = DateL"
MsgBox (DCount("*", "ManHoursQ" , CritStr))
MsgBox (DCount("*", "ManHoursQ" , CritStr1))
End If
----
So the first DCount gives me the correct answer. But the second DCount gives me the runtime error:
Run-time error '2471':
The expression you entered as a query parameter produced this error:'DateL'
-----
[Dt] is a Date field. Can anyone help me out? Thanks.
Comment