We help IT Professionals succeed at work.

Launching an Access form with pre-filled fields

hydrazi
hydrazi asked
on
Hello,

I am very lost in trying to get a button on a form to launch a second form using values entered in the first.  Basically, it is a quote form and I would like the users to hit a button to turn it into an Order.  Many of the field values should carry over from the Quote form to the Order form.

I can get the button to insert the record into an Order table, but not open and pre-populate a form.

Any direction is greatly appreciated.
Comment
Watch Question

An easy to do it would be to first open the Order Form, using the On Current Event, you can write code that will populate your fields using the Quote One like this for example:

Me!Name = Forms!frmQuote!Name
Me!Product = Forms!frmQuote!Product

At the end, you can close the Quote Form using

docmd.Close acForm, "frmQuote"
The other way (if table orders is filled with necessary data from first form) is to use query as source of second form, where order number or quote number (you know it better) from first form is used as a condition. This field is field, joining your tables (quote and order.
Top Expert 2009

Commented:
When doing the transfer of data, you might want to do a check on each field to ensure that all necessary fields have valid data -- no empty fields where an entry is required, no text in a Date field, etc.