on a form, with records that are sorted in the form's recordset query,
i have a command button with this code
Code:
Private Sub cmdNextType_2_Click()
Application.Echo False
strPrev_Current = Me.Type 'store value for action: Return To Previous Record
Call EODbNewType(Me) 'check if next record would be a new type, prompt to add if yes
'<...>
Code:
Public Sub EODbNewType(frm As Access.Form)
'check if next record is a 'new' record
If frm.RecordsetClone.RecordCount = frm.RecordsetClone.AbsolutePosition Then
With frm
gsMsgTitle = "END of DATABASE"
gsMsgText = "You are at the end of the database;" _
& vbCrLf & "Do you want to create a new record? "
gsMsgResponse = MsgBox(gsMsgText, vbQuestion + vbYesNo + vbDefaultButton1, gsMsgTitle)
If gsMsgResponse = vbYes Then
frm.Dirty = False
DoCmd.GoToRecord , , acNewRec
'<...>
HOWEVR,
when i am at the last record (view = single record)
frm.RecordsetClone.RecordCount
AND
frm.RecordsetClone.AbsolutePosition
are not equal, and i cannot tell why (and previously it used to work; so i had to have...)
thnx and appreciation in advance,
m.