Results 1 to 6 of 6
  1. #1
    jillp is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2012
    Posts
    12

    Unhappy saving problem

    Although I am not experienced at Access programming even I have realised that Access likes to save the data.
    But, somehow I have messed this up.



    I have a menu that opens a form as follows:

    Code:
    DoCmd.OpenForm "FrmNewScore"
    Forms!frmnewscore!ScoreName.SetFocus
    I then enter the details and have button that does a save and close as follows

    Code:
    If Me.Dirty Then Me.Dirty = False
       
        DoCmd.Close acForm, Me.Name
    If I then look at the table it is there.
    Until I do the next entry which just overwrites this one, I only ever have one entry in the table.

    What have I done

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    By default a form bound to a table will display existing records when opened. That means you're overwriting the first record as you have it. If you want this form to only enter new records, set its Data Entry property to Yes. Otherwise, determine exactly how you want to use it and we'll go from there.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jillp is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2012
    Posts
    12
    sorry, but where is the data entry property ?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    It's a property of the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    • In Form Design View, Right-Click on the Form, itself
    • Go to the Data Tab
    • Set the Data Entry Property to Yes.

    As Paul said, this will only allow the entry of New Records. You'd need a separate Form for the Viewing/Editing of Existing Records.

    If you need to retain the ability to do all of these tasks on a single Form
    • Forget about having the Data Entry Property set to Yes
    • Set Data Entry Property back to No
    • Add this code in the Form's code module

    Code:
    Private Sub Form_Load()
     DoCmd.GoToRecord , , acNewRec
    End Sub

    When the Form first Opens, it will be on a New Record, preventing the trigger-happy users from overwriting an existing Record. But existing Records will also be available, by use of the Navigation Buttons, to View or Edit those Records.

    Linq ;0)>

  6. #6
    jillp is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2012
    Posts
    12
    thanks very much again, I have choosen separate forms to add / view for simplicity.

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

Similar Threads

  1. Saving the current Date problem
    By smeghead67 in forum Access
    Replies: 2
    Last Post: 08-08-2012, 01:09 PM
  2. Replies: 2
    Last Post: 06-07-2012, 06:36 AM
  3. saving default value to field problem
    By sk88 in forum Access
    Replies: 3
    Last Post: 01-08-2012, 01:15 AM
  4. problem while saving database design
    By Ramya in forum Database Design
    Replies: 1
    Last Post: 08-02-2011, 07:39 AM
  5. Problem Saving Access 2007 to 2003 database
    By spkoest in forum Access
    Replies: 4
    Last Post: 05-03-2011, 04:44 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