Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010

    Unanswered: How to fill a record with data from the previous record automatically

    Hi Folks:

    I have an Access 2010 form already created.

    Much of the data that is entered is the same on each screen (we might have 5 or 6 records in a row that only have one field changed). After a record is submitted, I would like the new record to be pre-poplulated with the data from the previous submission.

    I'm hoping there is some way to do this using a Macro... I've never used VBA.

    Thanks for any help...


    P.S. I don't think it would make a difference, but the access form uses linked tables to an Oracle database.

  2. #2
    Join Date
    Apr 2005
    Zagreb - Croatia
    If you have only one field to change, it means that your tables not normalized well.

  3. #3
    Join Date
    Jun 2010
    Hi Mstef-ZG:

    Each week we receive x5 orders that differ only in one field. All of the fields though differ from week to week.

    Since I do not have the final say on changing the tables structure thats out of my control.

    While I appreciate your response, your response has nothing to do with helping me with my original question. I would appreciate help with the original question.


  4. #4
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    I don't think you will get a solution using macros, but as I don't use 'em I can't be certain on that
    What you want to do is trivial enough using VBA,
    place some code in the 'after update' /onafterupdate event that copies the old value to a global value in that code module

    then you need to place some code in the forms before insert (or possibly after insert event which cpoies the values from that varaible to the appropriate control

    so thatrs going to be something like

    dim mycontrolvalue as text //repalce with whatever datatype is appropriate

    in the forms after update event
    mycontrolvalue = acontrol.value

    in the before insert event

    if isnull (acontrol.value) or acontrol.value = nothing then
    acontrol.value = mycontrolvalue

    however thats air code and you will need to work on it to make certain t does the job you want

    you could modify it using a msg box to say do you want insert the value and so on
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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