New record event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I want to enable or disable some command buttons on a form as each record is
viewed as different records will have different options available. But I
can't find which form event is linked to a new record being viewed, can
someone please tell me?

Cheers,

Alasdair
 
Alasdair said:
Dear all,

I want to enable or disable some command buttons on a form as each record is
viewed as different records will have different options available. But I
can't find which form event is linked to a new record being viewed, can
someone please tell me?

Assuming a bound form using built in navigation buttons:

The form's OnCurrent event fires each time you navigate to a different
record.

The form's NewRecord property is true when you navigate to where a new
record can be entered.
 
Dear all,

I want to enable or disable some command buttons on a form as each record is
viewed as different records will have different options available. But I
can't find which form event is linked to a new record being viewed, can
someone please tell me?

Cheers,

Alasdair

Use the Form's Current event - which fires whenever you move to
another record; and check the Form's NewRecord property:

Private Sub Form_Current()
If Me.NewRecord Then
<do stuff for new records>
Else
<do stuff for old records>
End If
End Sub

John W. Vinson[MVP]
 
John Vinson said:
Use the Form's Current event - which fires whenever you move to
another record; and check the Form's NewRecord property:

Private Sub Form_Current()
If Me.NewRecord Then
<do stuff for new records>
Else
<do stuff for old records>
End If
End Sub

John W. Vinson[MVP]

John,

Thanks for the help, the NewRecord property is a useful trigger to use.

Cheers,

Alasdair
 
Back
Top