Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter by Form, passing variable to date field

Status
Not open for further replies.

kndavies

Technical User
Jan 23, 2003
30
GB
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top