G
Gary Dolliver
Hi all,
I have a search form used to look up records based on a number of entry
fields. I have, with the help of this forum, created successful searches for
all of the text like fields, but I also wanted to have a "# of weeks back"
filter as well. My crrent code is:
Dim strWhere As String
strWhere = "True"
If Not IsNull(Me.LastName) Then
strWhere = strWhere & " AND ShipTo_LName like """ & Me.LastName & "*"""
End If
If Not IsNull(Me.Organization) Then
strWhere = strWhere & " AND ShipT
rganization like """ & Me.Organization &
"*"""
End If
If Not IsNull(Me.ZipCode) Then
strWhere = strWhere & " And ShipTo_ZIP5='" & Me.ZipCode & "'"
End If
If Not IsNull(Me.PhoneNum) Then
strWhere = strWhere & " And ShipTo_Phone='" & Me.PhoneNum & "'"
End If
If Not IsNull(Me.Email) Then
strWhere = strWhere & " And ShipTo_Email like '" & Me.Email & "*'"
End If
If Not IsNull(Me.OrderNum) Then
strWhere = strWhere & " And Order_ID=" & Me.OrderNum
End If
DoCmd.OpenForm "INQUIRY_MAIN_View", , , strWhere
DoCmd.Close acForm, "INQUIRY_MAIN"
I would like to have weeks back included in this code, and then I could use
the "Date_Received" field within the orders table (which controls
INQUIRY_MAIN_View") to be compared to Date() - ([weeks_back]*7)
Any sample code would be most appreciated, thanks!
-gary
I have a search form used to look up records based on a number of entry
fields. I have, with the help of this forum, created successful searches for
all of the text like fields, but I also wanted to have a "# of weeks back"
filter as well. My crrent code is:
Dim strWhere As String
strWhere = "True"
If Not IsNull(Me.LastName) Then
strWhere = strWhere & " AND ShipTo_LName like """ & Me.LastName & "*"""
End If
If Not IsNull(Me.Organization) Then
strWhere = strWhere & " AND ShipT
"*"""
End If
If Not IsNull(Me.ZipCode) Then
strWhere = strWhere & " And ShipTo_ZIP5='" & Me.ZipCode & "'"
End If
If Not IsNull(Me.PhoneNum) Then
strWhere = strWhere & " And ShipTo_Phone='" & Me.PhoneNum & "'"
End If
If Not IsNull(Me.Email) Then
strWhere = strWhere & " And ShipTo_Email like '" & Me.Email & "*'"
End If
If Not IsNull(Me.OrderNum) Then
strWhere = strWhere & " And Order_ID=" & Me.OrderNum
End If
DoCmd.OpenForm "INQUIRY_MAIN_View", , , strWhere
DoCmd.Close acForm, "INQUIRY_MAIN"
I would like to have weeks back included in this code, and then I could use
the "Date_Received" field within the orders table (which controls
INQUIRY_MAIN_View") to be compared to Date() - ([weeks_back]*7)
Any sample code would be most appreciated, thanks!
-gary