Niswaar
08-03-2008, 01:58 AM
hi, i have searched the whole forum and couldnt just meet the situation hindered by me.
heres the issue............
Form: Client ID (300+ records)
Fields: File_ID, Last Name, Date of Birth
Form: Search
Fields: File_ID
I would like to search "Client ID" records FROM THIS FORM based on "File_ID"
here's what im using
Private Sub Search_Click()
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If File_ID
If Nz(Me.File_ID) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "Client_ID.File_ID Like '*" & Me.File_ID & "*'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "Results", acFormDS, , strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.Results.Form.Filter = strWhere
Me.Results.Form.FilterOn = True
End If
End Sub
Now, after clicking the search button, it asks me for "Enter Parameter Value" and further DOESNT filter the results...
Any help would be kindly appreciated.
Thanks in advance
heres the issue............
Form: Client ID (300+ records)
Fields: File_ID, Last Name, Date of Birth
Form: Search
Fields: File_ID
I would like to search "Client ID" records FROM THIS FORM based on "File_ID"
here's what im using
Private Sub Search_Click()
Dim strWhere As String
Dim strError As String
strWhere = "1=1"
' If File_ID
If Nz(Me.File_ID) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "Client_ID.File_ID Like '*" & Me.File_ID & "*'"
End If
If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "Results", acFormDS, , strWhere, acFormEdit, acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.Results.Form.Filter = strWhere
Me.Results.Form.FilterOn = True
End If
End Sub
Now, after clicking the search button, it asks me for "Enter Parameter Value" and further DOESNT filter the results...
Any help would be kindly appreciated.
Thanks in advance