Pre-fill form fields with data from a different data source

D

Damian

Please, excuse me if my question is a little dumb, but
this is the first time I use Access to create an
application and it's driving me nuts!
I will appreciate if anyone has an answer to this or can
point me to a previous answer.
The problem is this:

I have a DB with two sections: "Orders" and "Invoice"
"Orders" has two tables "Orders" and "OrderDetail" with a
one-to-many relationship by the OrderNumber (key on the
order table).
It also has a form to enter data on the "Orders" table,
with a sub-form to enter the order items in
the "OrderDetail" table.

In the "Invoice" section I have 2 scenarios: people that
didn't make an order and people who did.
For people who didn't make an order the case is similar
to "Orders", except that the record is set on
the "Invoice" (that has a couple of fields more
than "Orders") and "InvoiceDetail" tables .
But for people who did make an order I need them to choose
the order from a list (in a form called "OrderSelect") and
then send the selection made by the user to the following
form, pre-fill the fields with the "Orders" record (and
the subform fileds with the "OrderDetails" data) and store
the data (with a couple of extra fields) in the "Invoice"
and "InvoiceDetails" tables.

If I set "Invoice" as the data source for the form (to
store the data later) I don't know how to get the data
from the order the user selected on the previous form and
fill the desired fields (not to say that I also need to
pre-fill the sub-form).

Does anyone know the answer?
Is there an easy way to do it?
Or should I send ALL the data via the DoCmd.OpenForm
command and parse it?
Thanks,

Damian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top