thmsjlmnt3953
Registered User.
- Local time
- Today, 06:04
- Joined
- May 20, 2014
- Messages
- 120
Hi,
I have used this code many time shwoever its failing on this occasion, the product in question is for example "0066551 - test product" which appears in the continuous form and the textbox.
I have used this code many time shwoever its failing on this occasion, the product in question is for example "0066551 - test product" which appears in the continuous form and the textbox.
Code:
Private Sub Command9_Click()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yy\#"
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & "([Request_Date] >= " & Format(Me.txtStartDate, conJetDate) & ") AND "
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & "([Request_Date] < " & Format(Me.txtEndDate + 1, conJetDate) & ") AND "
End If
If Not IsNull(Me.txtProd) Then
strWhere = strWhere & "([Product] < " & Format(Me.txtProd + 1, conJetDate) & ") AND "
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
Me.FilterOn = False
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
Me.OrderByOn = True
Me.OrderBy = "[Request_Date] DESC"
End If
End Sub
Last edited: