Duplicate whole record (in form)

YZF

Registered User.
Local time
Today, 15:40
Joined
Nov 29, 2005
Messages
19
I have a form (with subform in it) and i fill it with different values. After some time, i need to fill another record (new one), with similar values.Is it possible to make a duplicate of my previous record, and put it in the "new record" so that i won't have to fill all fields again, only change excisting ones to different values.

Thanks
 
If the values are always similar, set default values for the records in the form or underlying table
 
No, values are different and each "previous" record has its own values, and his own OrderID. So at first i would like to select particular record in my (single) form, and then make a duplicate of all fields (except OrderID) to apear as the new (and already filled) record.

Is this possible somehow?
 
ShaneMan said:
Hey YZF,

If I'm following what your wanting to accomplish correctly, have a look at the following link:

http://www.mvps.org/access/forms/frm0012.htm

HTH,
Shane

Thanks for the reply, i'll look into it later, but i noticed one thing there:

"How do I carry forward the current value of a control so that it's automatically entered for all new records?"

Is it possible to make it for only one record? What should I change if i don't want to open next time my form and see those values there (as default)... ?
 
Yes, it's possible for just one record. If you use the code, at the link I gave you, the way that I've done it in the past is to put it in the cmdButton click event that is opening to the New Record.

HTH,
Shane
 
Thanks, only one question: how do i write it if i want a subform also carry forward?

I have subform in continuous mode, so if i write subform's link, it works, but it carries only first row from subform (first subform's record).How to make it carry all records from subform?
 
Last edited:
Duplicate Record - References on Tools

Sorry if my question seems dumb.

The microsoft solution says. "On the Tools menu, click References, and then click to select Microsoft DAO 3.6 Object Library. Click OK".

For the life of me I cannot find "References". Is there something that i am missing. I have searched the forums and Microsoft for a solution and I cannot seem to find it.

Thanks

Jamjarr
 
Ignore my last message. Sorry I found it. Whatta goof. It was in the VBA area and on the toolbar.
 
hi Guys im hoping this thread is still active.

is there a way to copy all data from a subform then open a new record and duplicate the records to be identical to the origional subformfrom copied from?
 
I know it's an old thread but in case you're still looking for an answer here's something that may help. I used both DAO and SQL. What this does is duplicate all the records in subquote for a certain a quote.

Code:
Dim tempQuoteID As Integer, tb As DAO.Recordset
tempQuoteID = Nz(DMax("QuoteID", "Quotes"), 0) + 1
Set tb = CurrentDb.OpenRecordset("Select * from subquotes where QuoteID =" & Me.QuoteID)
If Not tb.EOF Then tb.MoveFirst
Do While tb.EOF = False
    CurrentDb.Execute "INSERT INTO subquotes(quoteid,productid) values (" & tempQuoteID & "," & tb!ProductID & ")"
    tb.MoveNext
Loop
tb.Close
Me.Requery
DoCmd.GoToRecord , , acLast

Once done, it will requery the form and goto the last record which was just created.
 

Users who are viewing this thread

Back
Top Bottom