Copy record to another form

coolcatkelso

Registered User.
Local time
Today, 18:08
Joined
Jan 5, 2009
Messages
279
Hiya

I have a form called Quotes with a subform within... I need to copy a record over to Workorders also containing a subform

The idea behind this

Once you have created a quote, and the quote has been accepted, then a workorder will need to be created. So rather than filling out all the details again for a workorder, it would be easy to have button on Quotes - "Create Workorder"

I've dug around on google but not finding much that is that close

Best I've found is having this code

Code:
[Forms]![Quote ]![fieldname1] = [Forms]![Workorders]![fieldname2]
[Forms]![Quote subform ]![fieldname1] = [Forms]![Workorders subform]![fieldname2]

Would this be the correct way?

I did have code before on this but have since discovered that it isn't work just for quote.

The old code I have allows me to create the quote, Materials & Labour and create a workorder on click, this still works fine 100%

But, the issue I have with this code is that it won't store the Labour part in the quote.. It adds the total labour cost etc but its always looking for a "WorkorderID" which is shold only find when its a created as a workorder

So, if I open up quotes after I've filled everything out, The quote is visable, the materials (subform) is visable with data, but the Labour is visable but with no data visable although it has been created in the table.. Strange

Any one help?
________
Lovely Wendie
 
Last edited:
What about running a query?
Insert Into _____ select xyz from _____ where yourid = ____

Have a look at the recordsetclone method
 
Hiya

Cheers for the reply m8

Managed to get the old code working, found that I had an extra link in the Master / Child Links, I had QuoteID & WorkorderID. whereas it should've been just the QuoteID

Silly, simple mistake lol

But I will keep your suggestion in mind for next time,

Cheers
________
Peach
 
Last edited:
You won't be "copying". What you need to do is save your work-order data from Quotes to a table (which I assume you are actually doing). The second form, Workorder would then pull (query) the information you want from the table and also perform any associated calculations.
 
I would combine all estimates, quotes, workorders, invoices and credit notes in the same table as they are essentially the same information.

Include a field to indicate the their status and simply convert quotes to work orders by changing the status.

If a quote must be retained as well as the invoice the individual lines can have status flags to indicate Quoted, BackOrdered, Invoiced. The Transaction display form includes controls to show or hide the line records as appropriate when displaying the quote or invoice.
 

Users who are viewing this thread

Back
Top Bottom