but i
cannot get the append query information from the quote subform to get loaded
into the order subform on the newly created record on the order form.
is the primary key field of the orders table an Autonumber? if so, you'll
need to retrieve that value *after* you Append the quote record to the
orders table, and assign the value to the foreign key field of the order
materials table in the second Append query. the easiest way to do that is to
look up the record and get the primary key value, and assign it to an
unbound textbox control in the form (you can set the control's Visible
property to False, because the user doesn't need to see it). refer to that
control in the Append quote materials query with the following syntax, as
[Forms]![name of quotes form]![name of textbox control]
the code would be something like
DoCmd.SetWarnings False
DoCmd.OpenQuery "name of query to append quote record to order table"
Me!TextboxName = DLookUp("primary key fieldname", _
"name of orders table", "quote number fieldname = " _
& Me![name of quote number field in quote table])
DoCmd.OpenQuery "name of append quote materials query"
DoCmd.SetWarnings True
DoCmd.OpenForm "name of orders form", , , _
"name of quote number field = " & Me!name of quote number field
and keep in mind, you're not appending records into a *form*, you're
appending records into the orders table and order materials table - and
*displaying* those records in the orders form/order materials subform.
hth
CatchinOn said:
Tina, i do have a unique quote number on the quote form and it gets appended
to the order form's table. I also have the appended information from the
quote form correctly being loaded into a new record on the order form, but i
cannot get the append query information from the quote subform to get loaded
into the order subform on the newly created record on the order form.
The append query from my quote subform is getting the correct information,
but i cannot get it to load into the order subform.
Basically i think i need to take the information obtained from two append
quieries and load that informatuion into a newly created record on a form and
a subform,a dn i have all but the subforms linked up right.
I have been running through this all day and don't see my problem. The
subform append query is even getting the quoteID correct when it appends teh
info, so i would think it would link up but ya know. urrrgggggg...
Thanks for your patience and help...
-H-
:
yes, it makes sense. you can easily add an OpenForm action to your code,
after the Append queries run. BUT, you need a way to identify the specific
order record you're looking for. is there some unique value in the parent
quote record, that also gets appended into the parent order table? perhaps
each quote has a quote number, that gets included in the order table? once
you identify that unique value, you can use the
WHERE argument of the OpenForm action to return only the order record you
want to see. for example, let's say the parent quote table does have a quote
number field that holds a unique value for each record, Number data type,
AND there is a corresponding quote number field of the same data type in the
parent order table to hold that value when the record is appended. i'll just
call the field QuoteNo. open the order form, as
DoCmd.OpenForm "frmOrders", , , "QuoteNo = " & Me!QuoteNo
read up on the OpenForm action and its' arguments in VBA Help, so you'll
understand how it works.
hth
Okay i have the append queries working correctly, but how do i get the
information i have trasfered to be loaded into the order form and for the
order form to automatically open with the tranfered information loaded so
that my users can finish the order form? I hope this makes since... and
thanks again...
-H-
:
the data you enter in the quote mainform/subform is not stored in the
form,
it's stored in a table - unless your forms are not bound to tables, in
which
case you lose the data when you close the mainform.
assuming that the quote data *is* being written to tables, you should be
able to open a form and find an existing quote record, then use Append
queries to append first the parent quote record into the order table,
then
the related child material record(s) into the order details table.
hth
I have a situation where our clients will have already had our company
produce a quote for materials.
The quote i sproduced from a main quote form where the client's
project
information is entered, then a quote subform where the materials are
quoted.
Then at a later date when they want to place an order for the quoted
materials I would like to copy the information from the quote form and
quote
subform to our order form and order subform.
It would be great if there is a way to do this by opening the quote
form
to
review the details then by pressing a "Move to Order Form" button and
our
order form and order subform open with the information from the quote
form
and quote subform entered in the correct locations.
Any help or tips anyone can provide is greatly apprecieated. I've
been
banging my head on this form quite a while now.