Kate R said:
Hi How do I always get my access database to open waiting
for a new record to be typed? I need this instead of
showing an existing record because the primary reason for
opening the db for 99% of people will be to add
information.
Just to clarify, this isn't about how the *database* opens, it's about
how the *form* opens. Maybe the database automatically opens the form
on startup, but it's the form we're concerned with. At least, I trust
that it's a form you're talking about, and you are not opening a table
datasheet directly. That wouldn't be a good idea.
There are two main ways you could approach this with your form. The
simplest way would be to set the form's DataEntry property to Yes.
That's on the Data tab of the form's property sheet in design view. If
the form is set to open in Data Entry mode, it only ever shows a blank
record to be filled in. Once that record is filled in and the user
moves on to the next record, the old record disappears from the form.
The drawback to this approach is that you can't go back and review old
records using this form.
An alternative approach would be to open the form in normal mode, so
that all records are displayed on the form, but have it automatically go
to the new record. The other records would be available by paging back,
but the form would open to a blank record, ready to fill out. This
could be achieved by writing a little event procedure for the form's
Load event:
Private Sub Form_Load()
RunCommand acCmdRecordsGoToNew
End Sub
As a third alternative (I know, I said two, before) if the form is being
opened by code, you could let that code determine whether to open the
form in data entry mode or in normal mode, and specify it in the
arguments to the OpenForm method.