Ooops.
Hello
I have a set of Navigation buttons (Move First, Move Next, Move Previous, Move Last). Sometimes after a record was deleted,, the Error "2105 You can't go to the specified record" occurs, and sometimes it just jumps to a new record (showing a blank empty form like it's ready for entering new record).What was the possible cause ? How do I fix the error? If the"If err.number = 2105 then Resume ExitProcedure" was added in the ErrorHandler section, will the work or appropriate? Below is my code.Thanks
Phucon
Private Sub cmdDelContract_Click()
On Error GoTo ErrorHandlerPrivate Sub cmdNext_Click()
On Error GoTo ErrorHandler'Find the record and delete it.
Public Function FindFormRecord(SearchForm As Access.Form, SearchField As String, SearchValue As Variant, Optional NoMatchMessage As String = "Record not found") As BooleanMsgBox NoMatchMessage
GoTo ExitDelete
End If
Else
GoTo ExitDeleteExitDelete:
Exit FunctionErrorHandler: MsgBox Err.Number & vbCrLf & Err.Description
Resume ExitDelete
End FunctionPosted by: John Viescas <johnv@msn.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar