Search Box ~ Find Next button on form

TheFerrisFile

Registered User.
Local time
Yesterday, 23:10
Joined
Jul 7, 2006
Messages
16
I have a form where nurses enter claim numbers and the actions they have taken on those claims. At the bottom of this form is an unbound text box that they can search for a specific record with the following code (found on this lovely site):

Sub CboMoveTo_AfterUpdate()
Dim rs As DAO.Recordset

If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ONCLog_ClaimNo] = """ & Me.cboMoveTo & """"
If rs.NoMatch Then
MsgBox "The Record You Are Searching For Cannot Be Found"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub

This works great if there is only one record with that specific claim number, except that there are times when a nurse will have several records attributed to one claim number. This makes it impossible for the nurses to find the other records of the same claim, it only pulls up the first claim number...how do I attach a Find Next button to this unbound text box?
 
changing rs.FindFirst to rs.FindNext might do what you need, but i'm not positive.

i think you should also change

If Me.Dirty Then
Me.Dirty = False
End If

to

If Me.Dirty Then
docmd.runcommand accmdsaverecord
End If

this won't check to see if there are any errors on the form but will save the record properly.
 
Thank you for the response, except I need a button to toggle through the different records. How do I attach that button to my unbound text box and still use the search code?
 
No thanks, most of this stuff is plain Access. Sounds like you've decided to roll your own instead of using Access' power.
 
Maybe next time before insulting someone, you could think about the fact that not everyone is savvy with even the most basic functions of Access and provide a little insight as to the correct way of doing this.

Someone might take you as a jerk. I will chalk it up to you just having a bad day. But I would appreciate it if next time you just wouldn't respond if condescensions and insults are all you can provide.
 
Not having a bad day, just letting you know why you haven't got much help resolving it. I'd love to help you through some of the steps of using the form wizard to make a 1:M form that will allow your users to filter by claim number and work with multiple records. It's up to you.

I just don't think many people on a forum are going to be able to help you much with a coded design, that's all.
 

Users who are viewing this thread

Back
Top Bottom