copy form and subform details

steve111

Registered User.
Local time
Today, 08:54
Joined
Jan 30, 2014
Messages
429
hi ,

I have a form called "quote" and a subform called "quote details"
I also have a form called "orders "and a subform called "order details"


is it possible to press a buttom and copy the form I am in in "quote" which includes quote details to a new form in "orders" and order details.

thanks
steve
 
what do you mean by "copy", as in copy and paste?
 
hi

yes , copy and paste both form and subform
 
Yes. In the button's click event, you would do something like:

Forms![orders].YourFieldName = me.YourFieldName

Before that, make sure the orders form is open, and move to the appropriate record.

Before you get carried away, look into naming conventions. You don't want spaces in your form names either. I would name them something like:

frmOrders
frmOrdersSubDetails
frmQuotes
frmQuotesSubDetails
 
why would you want to copy details from one for to another form?

far easier to base the new form on the same data as the first form. But even so, why?
 
hI,

The first form is for quotes, and the auto number is the quote number . the form quote had the customer, date etc details the form orders had the part details

if we get the order I want to just copy the details over and create the order number and be able to modify and piece of data in the order details if needed.

i also want to be able to create an order even if it is not quoted

steve
 
2 ways.

one way is to make the quote and orders work on the same data - so you don't need to copy anything. you just change a field that moves the status of the order from Quote to Order.

the other way is to use an append query to insert the quote into the order table.
 
hi ,

re the append idea.
in the quote form the quoteid is the quote number, this links to the quote to the quote details
in the order form the ordered is the order number and this links to the order details

so I am not sure how to overcome this. I can append both the quote and quote details but I cannot link them in the order tables

thanks
steve
 
store the orderID somewhere, and in the append query insert the orderID in the appropriate column of the order header record, and the order lines records.

'from a form
forms!quoteform!orderid

'from a variable
Code:
 public ordered as long
  orderID = whatever

  function getOrderID() as long
  getorderID = orderID
 end function
'also using tempvars.
 
hi,

thanks fo all your help but I am struggling
I have attached a sample copy of my database. if possible I would like quote number 2 ( id number) to copy to the order form and this would be order no 1 ( again id number) as quote no1 did not become an order

thanks steve
 

Attachments

Took a peek at your database. I did not see how you were trying to create an order from a quote. If there a command button somewhere? Would you please point us to what you have tried.
 
Last edited:
I used the example in my previous link and adapted it to do what you need.

Using the navigation form makes form reference tricky because forms become sub forms. I find that using TempVars works great to pass data from sub forms to queries.. I used them to pass data to an append query.


See the attached
 

Attachments

hi , thanks for your help

it seems to be working great. I just had to reset the link master in the orders form because all records where going to all the orders.

I really appreciate your help.

I have posted another issue I would like to solve on the forms forum with a different problem
I would like to narrow the search down if possible , if you do have time could you please look at it

thanks
steve
 
Last edited:
hi , thanks for your help

it seems to be working great. I just had to reset the link master in the orders form because all records where going to all the orders.

I really appreciate your help.

I have posted another issue I would like to solve on the forms forum with a different problem
I would like to narrow the search down if possible , if you do have time could you please look at it

thanks
steve

Steve,

You're welcome. Glad we could assist.

I will look for your other post.
 

Users who are viewing this thread

Back
Top Bottom