Link to home
Start Free TrialLog in
Avatar of hfijalko
hfijalko

asked on

Carry over values from last record to new one

I need some help in carrying over the text from different fields into a new record when in is created.
ASKER CERTIFIED SOLUTION
Avatar of nexusnation
nexusnation
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dotthei
dotthei

you can also type CTRL+' in some situtations (also known as the "ditto key")
uh huh.  i use it :-)

the second idea (setting variables to the values, creating a new record, and then setting the values to the variables) is the CTRL+' but working for multiple fields at a time. plus, my second idea enables for some but not all of the fields to be duplicated.

nex
I made my earlier post and then switched back to a customer app that I am almost finished with -
there, I rewrote a Copy Shipping Address procedure using your code snip as a guide.

I don't pay commissions or royalties, though :-)
Avatar of hfijalko

ASKER

After I posted the question I found a solution elsewhere.  I will give you credit for the answer even though I did not try it out.
i want royalty! i want royalty! grrr...

a request for a grade change will be made. it does not cost more points to assign a better grade, and my answer was perfectly accurate. no hard feelings, hfijakco.

nex
also, i answered it before you said that you found another solution.

one one last note, what was your solution?
If you want a grade change I would be happy to accommodate you but I am unsure on how to do this.  I looked through the page to see where to do this but could find none.


Here is the solution that I found



Private Sub Form_AfterUpdate()
On Error GoTo Err_Form_AfterUpdate

    Dim ctl As Control
    For Each ctl In Screen.ActiveForm.Controls
        If ctl.Tag = "Move" Then
            ctl.DefaultValue = """" & ctl.Value & """"
        End If
    Next
   
Exit_Form_AfterUpdate:
    Exit Sub

Err_Form_AfterUpdate:
    MsgBox Err.Description
    Resume Exit_Form_AfterUpdate
End Sub


I then placed "Move"  in the Tag line of each field that you want carryed over.


Grade changed from C to A.  Thanks  hfijalko for posting your solution.  It has added great value to this PAQ.

SpideyMod
Community Support Moderator @Experts Exchange