Open form with no record showing

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

Allen Browne

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
 
J

John Vinson

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

Burton L. Alperson

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
 
B

Burton L. Alperson

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
 

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