tags:

views:

88

answers:

1

I'm having problems with the execution of ServerFilterByForm in Access 2003 When I apply the entered filter it returns the requested data but after it appear on screen (Form) it disappears. Don't know why this is happening

Does anyone had the same problem? How can it be solved? Heris is part of the code

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer) Dim stSql As String

If Len(ServerFilter) > 0 Then
    stSql = "SELECT * FROM v_InitialReviewQuery " & _
            " WHERE " + ServerFilter & _
            " ORDER BY acctnumber"

Else
    stSql = "SELECT top 1 * FROM v_InitialReviewQuery ORDER BY acctnumber"
End If


Me.RecordSource = stSql

End Sub

A: 

Try changeing this line

" WHERE " + ServerFilter & _ 

To

" WHERE " & ServerFilter & _ 

Also what is the value of ServerFilter?

Kevin Ross
David-W-Fenton
I did the change and got the same results.The Value of my server filter dependes on what the user use for filter. Let say that is using Contains part of string "Her" on field sFirstName the value of ServerFilter is sFirstName Like '%Her%'.Now when debugging I can see that the requested values are in Access. But after refreshing the page all info is gone from screen. I need to filter again with same values to get the info on screen.
JAVH