General discussion
-
Topic
-
Access 97 New Record problem
LockedI’ve been using the code below for about 2 years with no problem. Now I get a Run Time Error # 3021 – No Current Record
Any Ideas what happened???
***** CODE BEGINS****
Private Sub Form_Current()Dim recClone As Recordset
Dim intNewRecord As IntegerSet recClone = Me.RecordsetClone
‘ But we need to check if there are no records. If so,
‘ we disable all the buttons except for theIf recClone.RecordCount = 0 Then
[CMDNextDepend].Enabled = False
[Cmd Previous].Enabled = False
Else‘Synchonise the current pointer in the two recordsets
recClone.Bookmark = Me.BookmarkrecClone.MovePrevious
[Cmd Previous].Enabled = Not (recClone.BOF)
recClone.MoveNextrecClone.MoveNext
[CMDNextDepend].Enabled = Not (recClone.EOF)
recClone.MovePreviousEnd If
recClone.Close
End Sub
***** CODE ENDS *****Thanks!
Alan