Forum Moderators: open
WhereClause = "WHERE "
If Name <> "" Then
WhereClause = WhereClause & "(Name LIKE '%" & Name & "%') AND "
End If
If LastName <> "" Then
WhereClause = WhereClause & "(LastName LIKE '%" & LastName & "%') AND "
End If
If Email <> "" Then
WhereClause = WhereClause & "InStr(Email,'" & _
Email & "')>0 AND "
End If
If Address <> "" Then
WhereClause = WhereClause & "InStr(Address,'" & _
Address & "')>0 AND "
End If
If City <> "" Then
WhereClause = WhereClause & "InStr(City,'" & _
City & "')>0 AND "
End If
'You get the jist. I am trying to add search by date range. I want to bring up all record within the date range input. I know that the fomat the user inputs is critical.
"This code does not work.
If PostedFrom = "" And PostedTo <> "" Then
PostedFrom = "00/00/0000"
ElseIf PostedFrom <> "" And PostedTo = "" Then
PostedTo = "12/31/3000"
End If
If PostedFrom <> "" And PostedTo <> "" Then
WhereClause = WhereClause & "Posted >= " & _
PostedFrom & " AND Posted <= " & _
PostedTo & " AND "
End If
If I am not clear I will supply the search page. Thank you.