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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Records - Newbie confused

Status
Not open for further replies.
Apr 25, 2002
69
US
I've searched through the posts here on this topic and I'm still clueless. I have a form (frmSubmit) tied to a query (qrySubmit). Data is input for these fields: custID,BankName and xfer_amt (there are many more fields, but this is enough to start). Many times the same request is made more than once, so I want to copy a record previously created to a new record.
I created a button on frmSubmit that runs a parameter query (qryResubmit)to search by custID and attached it to another form frmResubmit. This brings up all the records for a particular customer in form view. Once the person choose the record that matches the current request, I want to copy the record from frmResubmit to a new record in frmSubmit. I created a button on frmResubmit and put the following in OnClick:

forms!frmResubmit.xfer_amt = forms!frmSubmit.xfer_amt
Docmd.close

I though this would copy the xfer_amt field from one form to the other, but it didn't work. The form closed without errors but the xfer_amt on frmSubmit was blank.
I can't figure out how to do this and I don't know if what I've done so far is the best way to go about it. There has to be an easier way to copy an entire record to a new record, yes? Any help or advice is greatly appreciated.
 
Hi. Let's clear up some terms first: You don't "copy a record to a form", you copy a record from a table, to a table. The form only displays the records.

I have a question: What is identifying the copied record as a unique record? Is there a different date stamp or something? If not, what's the reason for having duplicate records in the table?

Anyhow, you might do this instead: put a button on your Resubmit form, and follow the wizard to Record Operations + Duplicate Record. I'm not sure where or how it will then show up--you may then have to close and re-open the Submit form showing the newest record. You can do that in code in the button as well. Try out the Duplicate Record button wizard and then we'll go from there.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top