How to Start at a new record when form opens?

  • Thread starter Thread starter Bayou BoB
  • Start date Start date
B

Bayou BoB

Goodevening!

I'm working on my first database ever, which by the same token has an
extensive scope so I'm in a little over my head...the price you pay
for working for a small social services firm that can't afford their
own IT people. At any rate, when you open a form to input data, how do
you make it so that when the form opens, it is automatically open to a
new record, as opposed to how it stands now, where it opens, and is at
the very first record entered (record 1). While I seem to have been
able to do a great many other things so far, how to do this simple
thing is driving me crazy!! Any help would be greatly appreciated.
Thank you!

Kevin G. Howe
 
At any rate, when you open a form to input data, how do
you make it so that when the form opens, it is automatically open to a
new record, as opposed to how it stands now, where it opens, and is at
the very first record entered (record 1).

Two ways:

1. If you are willing to have the user JUST able to enter data, and
not see existing data, set the DataEntry property of the form to True.

2. More flexibly, open the Form in design view; view its Properties;
select the Events tab and choose the Open event. Click the ... icon
and choose the Code Builder. Access will give you a Sub and End Sub;
edit it to

Private Sub Form_Open(Cancel as Integer)
DoCmd.GoToRecord acNewRecord
End Sub
 
Bayou BoB said:
Goodevening!

I'm working on my first database ever, which by the same token has an
extensive scope so I'm in a little over my head...the price you pay
for working for a small social services firm that can't afford their
own IT people. At any rate, when you open a form to input data, how do
you make it so that when the form opens, it is automatically open to a
new record, as opposed to how it stands now, where it opens, and is at
the very first record entered (record 1). While I seem to have been
able to do a great many other things so far, how to do this simple
thing is driving me crazy!! Any help would be greatly appreciated.
Thank you!

Open the form in Design view and on the Data tab of the property sheet look for
the DataEntry property. Setting that to Yes will give you what you want.
 
Hi Kevin

There are many ways to go about. The simplest method is as
follow. Insert the following code in the "On Open" event
of the form:
DoCmd.GoToRecord , , acNewRec

Whalla!
Enjoy!
 
Back
Top