Hi guys,
New to the forum but not to Access. While I used it since the mid-nineties (for what I considered some fancy stuff; and still use some through a Virtual Machine with XP Pro), I never really got the hang of VB and what I need to do to properly address a database.
And I did earlier hi-jack a thread, thinking that was the way to go. But I was told that not to be so. So I apologize for that.
So here is my question: As for the above, I am trying to add custom navigation buttons to my one form. When I simply add the following code:
Code:
Private Sub cmdPrevious_Click()
MsgBox "Pete: this is on form current at the very beginning will NOT display; so what does that mean?", vbOKOnly ' MESSAGE will NOT display
On Error GoTo Err_cmdPrevious_Click
DoCmd.GoToRecord , , acPrevious
Exit_cmdPrevious_Click:
Exit Sub
Err_cmdPrevious_Click:
Select Case Err.Number
Case 2105
MsgBox "Pete: you are already at the beginning", vbOKOnly
Case Else
MsgBox Err.Number & "-" & Err.Description
End Select
Resume Exit_cmdPrevious_Click
End Sub
To my knowledge, the only other entry in all of 'code' is the prefix of "Option Compare Database" at the top of the form.
Do I need things like
Set db
Set RS???
to make this work. As I said, this kind of stuff I never quite worked out (which is why my older DB will not convert higher than Access 97).
I know I am asking a lot but would really appreciate your input since I am keen to make this form work for me.
And if I may add, my form is based on a Recordset and has Recordtype of Dynaset. Also, the Next, Previous and New buttons are in the Form Header; with the First and Last row buttons in the footer of the form.
I know I am asking a lot but would really appreciate your input since I am keen to make this form work for me.