Results 1 to 12 of 12
  1. #1
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20

    Save Field Entries

    On my form I have numerous fields - just like most forms once you tab thru the last field it saves the data and all the fields clear. What I would like if I could control some of the fields to retain the value in them for the next record. Is there a setting I can use to save the data until the form is closed and then clear once the form is reopened ?



    Thanks

  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,643
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    Wow, that was quick, is this for a constant default value ? On my form the value changes for each record. To make it a little clearer I am tracking aircraft post flight write-ups. So what I have found myself doing for the program I created is if the plane comes back with several writeups I am typing some of the same data for each write-up, i.e. plane number, flight number, date, over and over. Will what you gave me work for this senerio ?

    Thank You

  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,643
    In the after update event of a control, it should carry forward whatever value you enter. Why don't you try it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Just an additional thought...

    You can also use a combination of keystrokes, CTRL and ' (Apostrophe) and it will pull the data from the previous record's control and place it into the current record's control. Unfortunately, you would have to repeat the (CTRL & ') keystroke process for each control you wish to duplicate. However, in some cases, it makes sense and saves data input time.

    All the best !

    Jim

  6. #6
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    I certainly will try this; I have been looking for this solution for a long time. Not sure if I apply this code to each field that I want to retain its value when I move to the next record, do I have to add the name of the field to the code. I am somewhat of a novice but will experiment with it....


    Thank You - Greatly Appreciated

  7. #7
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    Thanks - I never heard of that but will start using it !

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Quote Originally Posted by gbwiii View Post
    Not sure if I apply this code to each field that I want to retain its value when I move to the next record, do I have to add the name of the field to the code.
    This solution you would add to the after update event of each control containing a field you wanted carried forward. You would replace "Control" with the name of your control.

    Another solution for multiple controls:

    http://allenbrowne.com/ser-24.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    Quote Originally Posted by pbaldy View Post
    I have been trying this and keep getting an error message, can not find the name of my control. I was told that the code that you mentioned below the top portion goes in the declarations of a module. I have never created a module. Does that sound right !
    const cQuote="""" 'Thats two quotes me!Control.DefaultValue = cQuote & me!Control.Value & cQuote

  10. #10
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    I got the code to work on all the fields that I want the data to carry forward to the next record, the only strange thing I see is one of my fields is a date field which the control name is Date. When the next record comes up it doesn't display what I typed in the previous record, what it displays in the Date field is 12:00:43 AM, What would cause that ?


    Thank you for your time !


    George

  11. #11
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    George -

    I don't know if this pertains to the problem you're having at the moment but, many experts have indicated that the use of Access reserved or keywords for field, object, or variable names, i.e. "Date", might cause some unexpected and unwanted behavior. You may want to consider changing the name of the "Date" field to something else.

    All the best,

    Jim

  12. #12
    gbwiii is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2011
    Posts
    20
    Thanks - This code worked for some of the fields on my form and the ones that it didn't I gave up and looked for another solution to carry forward the data to my next record and I found this code that works great. This is with my control names...With this I don't even need a module.

    Me![Pilot Last Name].DefaultValue = "'" & Me![Pilot Last Name] & "'"

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

Similar Threads

  1. Field with multiple entries....?
    By norlo in forum Database Design
    Replies: 1
    Last Post: 05-12-2011, 12:04 PM
  2. Query to group and count field entries
    By newtoAccess in forum Queries
    Replies: 4
    Last Post: 11-29-2010, 09:19 AM
  3. Displaying all the entries in one field
    By canfish in forum Reports
    Replies: 5
    Last Post: 07-29-2010, 02:19 PM
  4. Add a field on save.
    By emccalment in forum Forms
    Replies: 0
    Last Post: 02-23-2010, 04:41 PM
  5. Replies: 0
    Last Post: 06-03-2009, 10:25 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