trouble updating recordset

consultant29

Registered User.
Local time
Today, 04:24
Joined
Jun 29, 2006
Messages
10
Hello, thanks for reading.

I have a form that is based on dynamic query. There is a "main" form where a user selects search criteria from 2 fields. This then calls another form, where the results are displayed.

I am trying to update the record set at the top of my code in the form. I am getting a prompt to "enter a parameter" when I execute. Can some one help?

Database attached...


Public Function refresh()
' Check for LIKE job id
If Forms!main.job_id > "" Then
varWhere = varWhere & "[JobID] LIKE """ & [Forms]![main]![job_id] & "*"" AND "
End If

' Check for LIKE title and description
If Forms!main.keyword > "" Then
varWhere = varWhere & "[JobTitle] LIKE """ & [Forms]![main]![keyword] & "*"" AND "
End If



' Check if there is a filter to return...
If IsNull(varWhere) Then
varWhere = ""
Else
varWhere = "WHERE " & varWhere

' strip off last "AND" in the filter
If Right(varWhere, 5) = " AND " Then
varWhere = Left(varWhere, Len(varWhere) - 5)
End If
End If

BuildFilter = varWhere

' Update the record source
Me.RecordSource = "SELECT * FROM Acacia_Joblist_all_knowledge " & BuildFilter
End Function
 

Attachments

I don't find the function you have posted and your db has several compile errors.
 
RuralGuy said:
I don't find the function you have posted and your db has several compile errors.

The code is in the "knowledge results" form.

I am not sure about the compile errors, I don't get any. I had to compact the db a lot to be able to post it.

Soneone? Please help!
 
Here's your db back with just some minor changes. Does it demonstrate the issue you reported because I never saw it. It is also looking for several versions of group in the Main Form and throwing errors.
 

Attachments

Users who are viewing this thread

Back
Top Bottom