I have created my own navigation buttons and a "Record Number" field, which is read-only to the users. Now they want to be able to jump to a particular record number. is this an easy thing to change?
I tried changing the text box to locked = No and added code to its beforeUpdate event.
Code:
Private Sub Text_RecordNumber_BeforeUpdate(Cancel As Integer)
If Me.Text_RecordNumber.Value > 0 And Me.Text_RecordNumber.Value < updateRecordCount(Me) Then
Debug.Print "1 < " & CDbl(Me.Text_RecordNumber) & " < " & updateRecordCount(Me)
DoCmd.GoToRecord , , acGoTo, CDbl(Me.Text_RecordNumber.Value)
Else
Me.Text_RecordNumber = Me.Text_RecordNumber.OldValue
End If
End Sub
It prints the debug line, proving the value entered is within the correct range but I get a Run-time error '2105': You can't go to the specified record.
Help?