A
Asib
I am currently useing Allen Brownes Ecount to count distinct records in a
query. i was wondering if it was possible to adapt the code to count distict
records on a filtered continuous form? This is the code for the filter String.
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
If Not IsNull(Me.fltOrdno) Then
strWhere = strWhere & "([Ordno] Like ""*" & Me.fltOrdno & "*"") And"
End If
If Not IsNull(Me.fltItemNumber) Then
strWhere = strWhere & "([ITEM1]= """ & Me.fltItemNumber & """) And"
End If
If Not IsNull(Me.fltQtyord1) Then
strWhere = strWhere & "([QTYORD1] >= " & Me.fltQtyord1 & ") And"
End If
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then
MsgBox " No criteria", vbInformation, "Nothing to do."
Forms!TabbedForm!SubEverything!fltCustomer.SetFocus
Else
strWhere = Left$(strWhere, lngLen)
'Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
I have tried substituting the string for the query or table to no avail.
Any and all help or input is greatly appreciated.
Thanks, Asib
query. i was wondering if it was possible to adapt the code to count distict
records on a filtered continuous form? This is the code for the filter String.
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"
If Not IsNull(Me.fltOrdno) Then
strWhere = strWhere & "([Ordno] Like ""*" & Me.fltOrdno & "*"") And"
End If
If Not IsNull(Me.fltItemNumber) Then
strWhere = strWhere & "([ITEM1]= """ & Me.fltItemNumber & """) And"
End If
If Not IsNull(Me.fltQtyord1) Then
strWhere = strWhere & "([QTYORD1] >= " & Me.fltQtyord1 & ") And"
End If
lngLen = Len(strWhere) - 4
If lngLen <= 0 Then
MsgBox " No criteria", vbInformation, "Nothing to do."
Forms!TabbedForm!SubEverything!fltCustomer.SetFocus
Else
strWhere = Left$(strWhere, lngLen)
'Debug.Print strWhere
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub
I have tried substituting the string for the query or table to no avail.
Any and all help or input is greatly appreciated.
Thanks, Asib