|
-
March 17th, 2004, 11:49 PM
#1
Run-time error 3021 No current record
Hi,
In the beginning of database (access database) is empty and I want to add a new record and then cancel it. But I get an error
"Run-time error 3021 No current record" when I press Cancel button. Here is the code in cmdCancel:
Private Sub cmdCancel_Click()
Data1.UpdateControls
Data1.Recordset.Bookmark = vbookmark3
End Sub
-
March 18th, 2004, 05:29 AM
#2
I think ur bookmark is invalid
-
March 18th, 2004, 08:48 AM
#3
I'e run into this problem many times, especially when you start a new database without any records in it yet.
What I usually do is to set up an Error catch for it.
Ie.
(At beginning of procedure)
On Error Goto ErrorHandler
(Procedure)
ErrorHandler:
If Err.Number = 3021 Then
Resume Next (or other code)
Else
MsgBox Err.Number & vbCrLf & Err.Description
End If
This may help - Have a good day
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|