Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Selections

Status
Not open for further replies.

gobble

Technical User
Mar 21, 2002
28
GB
Hi
I need some help. I have a form which allows you to add records (one at a time). I wish to have a copy button on this form, when this copy button is pressed I would like a small form to appear from which the user has a choice of fields whose values they wish to copy from that record (preferable by tick boxes) then when they select OK the new record is shown with the values in the fields they selected.

Does anyone have any ideas?

Thanks
 
One way:

Create a property on the first form called UpdateData. When the small form appears build a string from the information you have select is some fashion that you can parse out the different field data. Then, when the small form closes you send the data to the Let Property UpdateData. This can then be handled as an event where you would parse out the different field data, save it to a variable, add a new record and load it with the values of the variables you stored, then null them out after you have used them.

Steve King

Form1
Let Property UpdateData(vData As variant)
'Parse out the different fields from the vData
'Place the values in a module level variable
'Go to a new record
'Insert the values of the variables in the new record in the OnCurrent event.
'Null out the values of the variables

Small Form
OnClose
Dim frm As New Form1
Set frm = Forms("Form1")
frm.UpdateData = ConcatenatedStringOfValues

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top