Event on search/find

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have produced a Db that has a form which has a diagram on it. This diagram
changes depending on what is in a certain field, status. Each time the form
is opened or a filter is applied the diagram is redrawn to reflect the
current record being shown. What i want now is to be able to search on a few
text fields, the problem this gives me is that i remove the filter and then
let them search but when they press find it goes to the next record matching
the find but the diagram doesn't change to reflect that record.

Is there an event that is fired the "find next" is pressed on the find form
that i can change to also run a bit of code to update the diagram?

Or can you think of any other way to do this?

Cheers

Danny
 
Hi Danny,

The Form_Current event procedure fires when opening the form, and each time
you navigate from one record to another. Perhaps you can enter some code
there to accomplish your desired task. You might want to include a test for
new record, and act accordingly, ie.

Private Sub Form_Current()
On Error GoTo ProcError

If Me.NewRecord = True Then
'Do something
Else
'Do something else
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, _
"Error in Form_Current event procedure..."
Resume ExitProc
End Sub



Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top