Results 1 to 5 of 5
  1. #1
    aolough is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    5

    Form entry replacing table record instead of adding new record

    Hi,

    I've a simple form connected to one table. The problem is that the new data entered via the form is replacing an existing record in the table, instead of just adding a new record. What am I missing?

    Recordset Type: Dynaset


    Data Entry, Allow Additions, Allow Deletion, Allow Edits all set to Yes

    Thanks

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Are you overtyping the existing data?

  3. #3
    pfunk is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2012
    Posts
    9
    you need to add a button that adds a new record. In design view of your form, under the controls section you will see a button option. Selct that and add it on to your form. The Command Button Wizard will appear. Here you will select Record Operations under Categories and then Add New Record under actions. Give it a picture or text (New Record). Name this button if you want and select finish. Then got back to form view and select the button add new information and do it again. (You may want to add a save record button as well). Close the form and select the table to ensure your new data was added! Hope that helps.

  4. #4
    uncletreetrunk is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jul 2012
    Posts
    72
    you can also use a little SQL to add the record to the table

    Code:
    Dim strSQL as String
    
    strSQL = INSERT INTO [tblname] ([fieldname1] , [fieldname2],...) VALUES ( " & Me.number & ", ' "& Me.string &" ', #"& Me.date &"#)
    
    Debug.Print strSQL
    CurrentDb.Execute(strSQL)
    http://www.baldyweb.com/ImmediateWindow.htm
    http://www.baldyweb.com/BuildSQL.htm

  5. #5
    aolough is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    5
    Thanks Rod, I was! Sorry I thought I replied to this sooner. Thanks for the other replies too.

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

Similar Threads

  1. Replies: 14
    Last Post: 05-25-2012, 02:40 AM
  2. Replies: 6
    Last Post: 04-17-2012, 10:32 AM
  3. Replies: 16
    Last Post: 06-21-2011, 09:08 AM
  4. Lookup List in a Form for Table Record entry...
    By noaccessguru in forum Forms
    Replies: 1
    Last Post: 05-05-2011, 12:35 AM
  5. Replies: 1
    Last Post: 03-29-2010, 04:11 AM

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