Open form with no record showing

  • Thread starter Thread starter Burton L. Alperson
  • Start date Start date
B

Burton L. Alperson

When Access opens a form, it shows the first record in the table. I would
like to open a form with all fields blank. Can anyone suggest a way to do
this?

Thanks,

Burt
 
A simple solution is to set the form's DataEntry property to Yes. It then
loads with no records showing, i.e. ready to enter new data. If you need to
find an old record, you can show all the old records by setting the form's
FilterOn property to No.

An alternative is to add this line to the Load event procedure of the form:
If Not Me.NewRecord Then RunCommand acCmdRecordsGoToNew
 
When Access opens a form, it shows the first record in the table. I would
like to open a form with all fields blank. Can anyone suggest a way to do
this?

Thanks,

Burt

Two ways:

- Set the form's Data Entry property to Yes. This does what you ask,
but has the disadvantage that you cannot use the form to look at
existing records.

- Put the following code in the Form's Open event:

Private Sub Form_Open(Cancel as Integer)
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End Sub

John W. Vinson[MVP]
 
A simple solution is to set the form's DataEntry property to Yes. It
then loads with no records showing, i.e. ready to enter new data. If
you need to find an old record, you can show all the old records by
setting the form's FilterOn property to No.

An alternative is to add this line to the Load event procedure of the
form:
If Not Me.NewRecord Then RunCommand acCmdRecordsGoToNew

The alternative worked like a charm.

Thank you,

Burt
 
Two ways:

- Set the form's Data Entry property to Yes. This does what you ask,
but has the disadvantage that you cannot use the form to look at
existing records.

- Put the following code in the Form's Open event:

Private Sub Form_Open(Cancel as Integer)
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End Sub

John W. Vinson[MVP]

Problem solved.

Thank you,

Burt
 
Back
Top