Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / March 2005

Tip: Looking for answers? Try searching our database.

Opening up property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate R - 04 Mar 2005 19:39 GMT
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.

Any Ideas?

Thanks a lot.
Kate R
Sandra Daigle - 04 Mar 2005 19:52 GMT
If you are using docmd.openform to open a form you can use the Datamode
parameter:

docmd.OpenForm "MyForm",,,,acFormAdd

or

docmd.OpenForm "MyForm",datamode:=acFormAdd

Signature

Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.

> Hi How do I always get my access database to open waiting
> for a new record to be typed? I need this instead of
[quoted text clipped - 6 lines]
> Thanks a lot.
> Kate R
Dirk Goldgar - 04 Mar 2005 19:53 GMT
> 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.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.