Results 1 to 2 of 2
  1. #1
    sbrown18 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1

    Cool Opening a new blank form rather than first record in the table

    Hi guys



    I have created an asset database but have a problem with one of the forms.
    I have a form with the button 'New Asset' and when I click it opens a New Asset form so I can enter new asset details. The problem is that it opens the first record in the table rather than a brand new (empty) record which I require. Can anyone help.

    The code I have on the 'New Asset button' is below

    Private Sub Openad_Click()
    On Error GoTo Openad_Click_Err
    DoCmd.OpenForm "Asset Details", acNormal, acFormAdd
    On Error Resume Next
    DoCmd.Requery ""
    DoCmd.GoToRecord , , acNewRec
    Openad_Click_Exit:
    Exit Sub
    Openad_Click_Err:
    MsgBox Error$
    Resume Openad_Click_Exit
    End Sub

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Paste only this line to the onclick event of your button

    DoCmd.OpenForm "Asset Details", acNormal, , , acFormAdd

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo box shows blank on opening the Form
    By Alex Motilal in forum Forms
    Replies: 7
    Last Post: 01-15-2010, 11:59 AM
  2. Opening form to correct record. Bookmark?
    By stephenaa5 in forum Forms
    Replies: 11
    Last Post: 12-29-2009, 02:43 PM
  3. blank on entry on add a record form
    By gmee in forum Forms
    Replies: 1
    Last Post: 10-07-2009, 07:31 AM
  4. Replies: 4
    Last Post: 07-22-2009, 02:33 PM
  5. Replies: 1
    Last Post: 03-15-2009, 04:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums