transfer data between forms using Macro and VBA

C

Charlienews

Hi,

I'm not sure if this can be achieved but I am trying to do the following:

I have a button which runs a macro to open a new order with all fields
empty. I want to add some code that will populate the corresponding fields
from the quote e.g. CompanyID, Contact ID, Job Description, Title etc.

I would use the following code to populate the fields:
[Customer] = Forms![Quotes]![Customer]
[JobDescription] = Forms![Quotes]![JobDescription]

What I need ideally is code that will open the form and populate the
relevant fields without the need for the macro. Everytime I use the wizard
when I create the button, it gives me all the orders which is not helpful.

Any suggestions would be great.

Thanks in advance

Charlie
 
M

Mike Painter

Charlienews said:
Hi,

I'm not sure if this can be achieved but I am trying to do the
following:
I have a button which runs a macro to open a new order with all fields
empty. I want to add some code that will populate the corresponding
fields from the quote e.g. CompanyID, Contact ID, Job Description,
Title etc.
I would use the following code to populate the fields:
[Customer] = Forms![Quotes]![Customer]
[JobDescription] = Forms![Quotes]![JobDescription]

What I need ideally is code that will open the form and populate the
relevant fields without the need for the macro. Everytime I use the
wizard when I create the button, it gives me all the orders which is
not helpful.

If everything is the same then turning a quote into an order is simply a
matter of changing a field value from "Quote" to "Order" or having a Boolian
field to do the same.

If not then OpenArgs should be used to pass the information from the tables
or queries that the form is based on.
A query is better and it would only need the quote ID if the tables are
properly related.
 

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