Form opens to blank record

  • Thread starter Thread starter Confused87
  • Start date Start date
C

Confused87

I have a front page (a form) and my main database linked via a command button
- it keeps opening on a particular record and I want it to open onto a blank
record - how do I go about changing this?

Thanks
C

(P.S. only a shakey understanding of code so if answer includes this - go
easy on me and explain! Thanks)
 
When you say:

" I have a front page (a form) and my main database linked via a command
button..."

you are not talking about the use of Microsoft Office FrontPage, are you?
http://www.amazon.com/Microsoft-FrontPage-2003-OLD-VERSION/dp/B0000AZJV8

I *think* you mean a switchboard type form that opens when the database is
opened. This switchboard form includes a button to open a different form. It
is this different form that you want to open in AddNew mode. Is this correct?
If your answer is "yes", there are three ways to accomplish your goal:

1.) Set a form property for Date Entry to Yes. You can display the
properties dialog by pressing the F4 button when you have the form open in
design view. This property is found on the Data tab, when you are displaying
the properties for the form itself (not for a section or control on the form).

2.) Use a macro to open the form in AddNew mode
Action: OpenForm
Data Mode: Add <---Found in the lower half of screen, once you select
OpenForm.

3.) Use VBA code with the optional

DoCmd.OpenForm "FormName", DataMode:=acFormAdd

where FormName is the actual name of your form. For example:

Option Compare Database
Option Explicit

Private Sub cmdAddJob_Click()
On Error GoTo ProcError

DoCmd.OpenForm "frmJobs", DataMode:=acFormAdd

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in cmdAddJob_Click event procedure..."
Resume ExitProc
End Sub



Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
Back
Top