S
shiro
Hi all,
It's strange.
Dcount formula return incorrect result if I define
where condition on open form even.I have some code
on click even of cmd_OK button.The code is :
'====================================
Dim strMessage as String
Dim strFilter as String
If IsNull(Me.PartName_txt) Then
strMessage = strMessage & _
"Enter Part name" & vbCrLf
Else
strFilter = "[Part Name] = [Forms]![Filter Data_frm]![PartName_txt]"
End If
If IsNull(Me.Lot_txt) Then
strMessage = strMessage & _
"Enter product Lot No" & vbCrLf
Else
strFilter = "[Lot No] = [Forms]![Filter Data_frm]![Lot_txt]"
End
If Len(strMessage)=0 Then
Me.Visible = False
DoCmd.OpenForm "Sales Product", acNormal, , strFilter
Else
MsgBox strMessage, vbOKOnly, "Invalid Filter"
End If
'=====================================================
The code return incorrect Dcount result,although the filter
return zero records,the value of Dcount is 1,325.
If I remove the strFilter from my code and put it in the
query's criteria row of "Sales Product" form ,
the Dcount work correctly.
What is wrong with my Dcount field?Hope somebody would like
to help me out of this problem?
Thank's
Rgds,
Shiro
It's strange.
Dcount formula return incorrect result if I define
where condition on open form even.I have some code
on click even of cmd_OK button.The code is :
'====================================
Dim strMessage as String
Dim strFilter as String
If IsNull(Me.PartName_txt) Then
strMessage = strMessage & _
"Enter Part name" & vbCrLf
Else
strFilter = "[Part Name] = [Forms]![Filter Data_frm]![PartName_txt]"
End If
If IsNull(Me.Lot_txt) Then
strMessage = strMessage & _
"Enter product Lot No" & vbCrLf
Else
strFilter = "[Lot No] = [Forms]![Filter Data_frm]![Lot_txt]"
End
If Len(strMessage)=0 Then
Me.Visible = False
DoCmd.OpenForm "Sales Product", acNormal, , strFilter
Else
MsgBox strMessage, vbOKOnly, "Invalid Filter"
End If
'=====================================================
The code return incorrect Dcount result,although the filter
return zero records,the value of Dcount is 1,325.
If I remove the strFilter from my code and put it in the
query's criteria row of "Sales Product" form ,
the Dcount work correctly.
What is wrong with my Dcount field?Hope somebody would like
to help me out of this problem?
Thank's
Rgds,
Shiro