Simply put, I have a form where I've hidden the built-in nav buttons and made my own using the button wizard to make the following buttons: First, Previous, New, Next, and Last. All is well here.
I took it a step further and added this code to the form's OnCurrent event:
This essentially greys out the first/prev and last/next buttons on 1st and last record of recordset. This too, is all good. Works fine.
THE PROBLEM: When creating a new record, it crashes with Error 3021 No current record. Any suggestions? Thanks in advance!
I took it a step further and added this code to the form's OnCurrent event:
Code:
Dim recClone As Recordset
Set recClone = Me.RecordsetClone()
recClone.Bookmark = Me.Bookmark
recClone.MovePrevious
BtnNavPrevious.Enabled = Not (recClone.BOF)
BtnNavFirst.Enabled = Not (recClone.BOF)
recClone.Bookmark = Me.Bookmark
recClone.MoveNext
BtnNavNext.Enabled = Not (recClone.EOF)
BtnNavLast.Enabled = Not (recClone.EOF)
THE PROBLEM: When creating a new record, it crashes with Error 3021 No current record. Any suggestions? Thanks in advance!