run-time error 3131 (1 Viewer)

jenswave25

New member
Local time
Today, 06:20
Joined
Jun 8, 2006
Messages
7
Please help - cannot figure out why the search form I have keeps returning the run-time error 3131. Syntax error in FROM Clause. Everything looks good, and I have even rennamed objects in hopes that I didn't steel a naming convention. Put brackets around qrys etc. Nothing, so please anyone (a new set of eyes would be great). Below is the code line returning the error.

Private Sub btnSearch_Click()

' Update the record source
Me.frmsubSearchResults.Form.RecordSource = "SELECT * FROM [qryRecordsData] " & BuildFilter

' Requery the subform
Me.frmsubSearchResults.Requery
End Sub
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 05:20
Joined
Aug 30, 2003
Messages
36,118
It would be helpful to know what BuildFilter did.
 

mercy

Registered User.
Local time
Today, 05:20
Joined
Aug 4, 2006
Messages
10
Sorry mate, could not get your point at all.
 

jenswave25

New member
Local time
Today, 06:20
Joined
Jun 8, 2006
Messages
7
Thanks

Thanks pbaldy - the error was in the BuildFilter. Specificaly it was trying to filter for a field that was removed. Removed the unnecessary code for the field and the BuildFilter worked and so did the Search.
 

Users who are viewing this thread

Top Bottom