I'm getting this error and its annoying me because I don't know why I'm getting it. It's design to be the "previous button" to move to the previous record. I've compacted & repaired and exported all objects to another database & I'm still getting this error. What's irritating me the most is that I have the EXACT SAME CODE on another form and it's working as designed . What's even worse than that is I have a control right next to it that calls my "next_btn" function that is designed the same way and it works. My code is below. Somebody please help me, thanks in advance.
Code:
Private Sub prev_lbl_Click()
'navigation module
prev_btn
End Sub
This the code that it calls:
Code:
Public Function prev_btn()
On Error GoTo Err_prev_btn
DoCmd.GoToRecord , , acPrevious
Exit_prev_btn:
Exit Function
Err_prev_btn:
'error_handling module
GlobalErrHandler
Resume Exit_prev_btn
End Function
Here is the "globalerrhandler" function
Code:
Sub GlobalErrHandler()
' Comments: Main procedure to handle errors that occur.
Dim strError As String
Dim lngError As Long
Dim intErl As Integer
Dim strMsg As String
' Variables to preserve error information
strError = err.Description
lngError = err.Number
Select Case lngError
Case 2105
MsgBox "Information in a required field is missing"
Case 2046
MsgBox "The delete button is not available. "
Case Else
' Prompt the user with information on the error:
strMsg = "Error: (" & lngError & ") " & strError
MsgBox strMsg
End Select
End Sub