H
HLCruz via AccessMonster.com
I have a search text field in the header of my form that I've used in many
other instances to search but for some reason my code wasn't working today.
I've messed around with it a little this morning and seemed to have made it
worse ... it must be one of those days ...
Maybe a fresh set of eyes would catch my mistake? Thanks to anyone who will
look ...
Private Sub txtIDSearch_AfterUpdate()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[MailingID] = """ & Str(Nz(Me![txtIDSearch], 0)) & """"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error - Key Not Found"
Resume ExitProc
End Sub
Private Sub txtIDSearch_Enter()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[MailingID] = """ & Str(Nz(Me![txtIDSearch], 0)) & """"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error - Key not found"
Resume ExitProc
End Sub
other instances to search but for some reason my code wasn't working today.
I've messed around with it a little this morning and seemed to have made it
worse ... it must be one of those days ...
Maybe a fresh set of eyes would catch my mistake? Thanks to anyone who will
look ...
Private Sub txtIDSearch_AfterUpdate()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[MailingID] = """ & Str(Nz(Me![txtIDSearch], 0)) & """"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error - Key Not Found"
Resume ExitProc
End Sub
Private Sub txtIDSearch_Enter()
' Find the record that matches the control.
On Error GoTo ProcError
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[MailingID] = """ & Str(Nz(Me![txtIDSearch], 0)) & """"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
ExitProc:
Exit Sub
ProcError:
MsgBox "Error - Key not found"
Resume ExitProc
End Sub