New record event

A

Alasdair

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
 
R

rkc

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.
 
J

John Vinson

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]
 
A

Alasdair

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top