Hello -
I have the following Procedure:
Private Sub Course_IDFilter_Exit(Cancel As Integer)
Dim StringWhere As String 'The criteria string.
Dim lngLen As Long 'Length of the criteria string to
append to.
Me.Filter = "[Course_ID]=[Course_IDFilter]"
Me.FilterOn = True
End Sub
The objective is to apply a filter to the data in the detail section of a
form for all records with [Course_ID] = to the number in the unbound
[Course_IDFilter] field after a course ID is entered into it.
The filter works, but I get an "Enter Parameter Value" window that asks me
to enter the [Course_IDFilter] value again.
What have I missed?
many thanks
sandy
Sprinks - 31 Jan 2007 20:21 GMT
Sandy,
You are mixing a string literal with the value of either a field or control
name. If the value in [Course_IDFilter] is a number, try:
Me.Filter = "[Course_ID] = " & [Course_IDFilter]
If the value is a string enclose the value in single quotes:
Me.Filter = "[Course_ID] = " & "'" & [Course_IDFilter] & "'"
Hope that helps.
Sprinks
> Hello -
>
[quoted text clipped - 22 lines]
> many thanks
> sandy
Sandy - 31 Jan 2007 20:24 GMT
THANK YOU!!!
> Sandy,
>
[quoted text clipped - 36 lines]
> > many thanks
> > sandy