Hello,
I am trying to add a criteria to a form. I am pulling the data from a table. All the criteria are working correctly except for the last one "date". The data type for date is "Date/Time. The other fields are all text. See text in bold and underline.
When i go to the text box in the form and enter the date the following message is received from Access: "Enter Parameter Value", then when i enter the date all the records are returned. The filter is not working.
see code below
'Constant Select statement for the RowSource
strSQL = "SELECT issues.id, issues.Month,issues.ApprovingOfficial, issues.CardHolder, issues.RequisitionNumber, issues.TransactionNumber, issues.Category, issues.Status,issues.DateIssueOpened,issues.Close_ Date,issues.Last_Update_Date,issues.date " & _
"FROM issues"
strWhere = "WHERE"
strOrder = "ORDER BY issues.id;"
'Set the WHERE clause for the Listbox RowSource if information has been entered into a field on the form
If Not IsNull(Me.CardHolder) Then '<--If the textbox txtcardholder contains no data THEN do nothing
strWhere = strWhere & " (ISSUES.cardholder) Like '*" & Me.CardHolder & "*' AND" '<--otherwise, apply the LIKE statment to the QueryDef
End If
If Not IsNull(Me.ApprovingOfficial) Then
strWhere = strWhere & " (ISSUES.approvingofficial) Like '*" & Me.ApprovingOfficial & "*' AND"
End If
If Not IsNull(Me.RequisitionNumber) Then
strWhere = strWhere & " (ISSUES.RequisitionNumber) Like '*" & Me.RequisitionNumber & "*' AND"
End If
If Not IsNull(Me.TransactionNumber) Then
strWhere = strWhere & " (ISSUES.transactionnumber) Like '*" & Me.TransactionNumber & "*' AND"
End If
If Not IsNull(Me.Category) Then
strWhere = strWhere & " (ISSUES.category) Like '*" & Me.Category & "*' AND"
End If
If Not IsNull(Me.Status) Then
strWhere = strWhere & " (ISSUES.status) Like '*" & Me.Status & "*' AND"
End If
If Not IsNull(Me.Date) Then
strWhere = strWhere & " (ISSUES.date) " = " " & Me.Date & "' AND"
End If