Hi,
I am using filter by form but have a problem with the date field; manually I can type "between #01/01/03# and #30/07/03#" and it works as I would want it to, however I need to make it easier for the user to enter date criteria and have created a form so they simply choose the operator and the date(s). This creates a string in the correct structure but when I try to apply it to the date field I get the message "Run time error 2448, You can't assign a value to this object."
The code is:
Private Sub cmdBtnApplyDate_Click()
Dim fltStr As String
If Me.cboOps = "Between" Then
fltStr = Me.cboOps & " #" & Me.fltStart & "# and #" & Me.fltEnd & "#"
Else: fltStr = Me.cboOps & " #" & Me.fltStart & "#"
End If
Forms![frm7 search].[Date] = fltStr
End Sub
Filter by form is new to me(!) and no doubt the solution is easy - someone please enlighten me!!
Many thanks,
Ken
I am using filter by form but have a problem with the date field; manually I can type "between #01/01/03# and #30/07/03#" and it works as I would want it to, however I need to make it easier for the user to enter date criteria and have created a form so they simply choose the operator and the date(s). This creates a string in the correct structure but when I try to apply it to the date field I get the message "Run time error 2448, You can't assign a value to this object."
The code is:
Private Sub cmdBtnApplyDate_Click()
Dim fltStr As String
If Me.cboOps = "Between" Then
fltStr = Me.cboOps & " #" & Me.fltStart & "# and #" & Me.fltEnd & "#"
Else: fltStr = Me.cboOps & " #" & Me.fltStart & "#"
End If
Forms![frm7 search].[Date] = fltStr
End Sub
Filter by form is new to me(!) and no doubt the solution is easy - someone please enlighten me!!
Many thanks,
Ken