G
Guest
I am trying to find the first record in the current form, and make sure that the PREVIOUS button is disabled when I am on that first record
(I get errors when I am on the first record and I click previous
The first field (primary key) in the table is called gameID, and it is an autonumber starting at 1. So I had it look for that record. Maybe my syntax is wrong for that function
Here is the code I have
Private Sub Form_Current(
'If the form is on a new record, we should disable the NEXT butto
'Shift the focus first, if there is a value in gameID, we must enabl
Dim firstrecord As Recordse
firstrecord = DoCmd.FindRecord(gameID = 1, , , , , , True
If Me.NewRecord = True The
cmdPrevious.SetFocu
cmdNext.Enabled = Fals
Els
cmdNext.Enabled = Tru
End I
If Me.CurrentRecord = firstrecord The
cmdPrevious.Enabled = Fals
End I
End Su
-----------------------------------------------
But the debugger keeps telling me
Expected function or variable at this line of code
firstrecord = DoCmd.FindRecord(gameID = 1, , , , , , True
Any ideas?
(I get errors when I am on the first record and I click previous
The first field (primary key) in the table is called gameID, and it is an autonumber starting at 1. So I had it look for that record. Maybe my syntax is wrong for that function
Here is the code I have
Private Sub Form_Current(
'If the form is on a new record, we should disable the NEXT butto
'Shift the focus first, if there is a value in gameID, we must enabl
Dim firstrecord As Recordse
firstrecord = DoCmd.FindRecord(gameID = 1, , , , , , True
If Me.NewRecord = True The
cmdPrevious.SetFocu
cmdNext.Enabled = Fals
Els
cmdNext.Enabled = Tru
End I
If Me.CurrentRecord = firstrecord The
cmdPrevious.Enabled = Fals
End I
End Su
-----------------------------------------------
But the debugger keeps telling me
Expected function or variable at this line of code
firstrecord = DoCmd.FindRecord(gameID = 1, , , , , , True
Any ideas?