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?
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?