Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Question Unanswered: Carry current value of a control to new records

    Hi guys I have a question, How do I carry forward the current value of a control so that it's automatically entered for all new records. I'm still trying to work on this issue, found this on a website, just trying to make sure I'm coding this correctly. It says to carry the current value of the control forward if you place this code behind a command button to conditionally run it. Now I have about 5 fields that I would need to run this on (hope I'm saying that correctly). Not sure how I would implement that. Can some one help please


    const cQuote=""""
    me!Earned_hours.DefaultValue = cQuote & me!Earned_hours.Value & cQuote

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by desireemm
    It says to carry the current value of the control forward if you place this code behind a command button to conditionally run it.
    I wouldn't put it in a command button, I'd simply place your code in the AfterUpdate event of each control you want to do this to, changing the control names as approriate. From that time forward, until you either edit the data by overwriting it or close the form, the values will be carried forward.
    Last edited by Missinglinq; 09-13-09 at 11:54.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jan 2010
    Posts
    1
    I used Missinglinq's advice and put the code in the AfterUpdate of the control that I wanted to carry over and it works just fine. However, it is not saving that data to the table that my form writes all the information to. Why is this and is there anyway to fix it?

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Is the control in question bound to the table? You say it places the value in the next record's control, and not having it bound is the only reason I can think of that it wouldn't be saved.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •