How to create a button to copy from a previous record and paste into current record?

I_M_Desperate

New member
Local time
Today, 12:40
Joined
Jan 11, 2013
Messages
6
I have been trying to figure this out for days with no luck. What I am trying to do is create a button on a form that when clicked while viewing the current record:

-goes to a certain previous record, specified by prompting the user to enter the primary key of the desired record, (in this case, a unique name)

-copies the data from all but a few certain fields in said record,

-Goes back to the current record and pastes all the data it copied into the appropriate fields.

One million cool points to whoever figures this out for me!
 
Welcome aboard:)
"previous" has no technical meaning in a relational database. How will you decide what record you want to get values from?

One frequently used technique is to copy all values from controls to the control's .tag property. You would need to do this in two places - the form's Current event and the form's AfterUpdate event. The current event handles the situation where the previous record was read but not changed and the AfterUpdate event handles the situation where the previous record was changed or newly added. Then in the form's BeforeInsert event, you could copy the values from the .tag property to the current record.

I don't have any code to post because my tables are all normalized and I have never needed to do this. If you search here, you should find actual examples. Search for the .tag property because that is the technique you are most likely to find.
 
Give me a sample of your form, which fields you want to copy, where you want the button and I will do it for you.
 
Valery, I think I_M_Desperate heeded to Pat's advice and found a solution or I_M_Desperate decided it was not worth the effort, so did not bother.. As the thread is about 5 months old..
 

Users who are viewing this thread

Back
Top Bottom