View Full Version : run-time error 3131


jenswave25
08-02-2006, 02:09 PM
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
08-02-2006, 02:29 PM
It would be helpful to know what BuildFilter did.

mercy
08-03-2006, 08:39 PM
Sorry mate, could not get your point at all.

jenswave25
08-04-2006, 11:20 AM
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.