Run VBA when first record is selected

Pslice

Registered User.
Local time
Yesterday, 23:03
Joined
Jan 26, 2012
Messages
16
is there anyway to run vba on the first record only? I want to run a conditional statement during the OnCurrent event. Something like
Code:
Private Sub Form_Current()
On Error GoTo Form_Current_Err

If Form = FirstRecord Then
MsgBox "First Record"
End If

Form_Current_Exit:
    Exit Sub

Form_Current_Err:
    MsgBox Error$
    Resume Form_Current_Exit

End Sub
 
Try;

Code:
If Me.CurrentRecord = 1 Then
   'Do something
End If
 

Users who are viewing this thread

Back
Top Bottom