LookUp in macro? - Access 2003

E

Eric Gillis

I'm building a database to process sales leads and orders. Data from
the leads AND orders are stored in the same table ("Orders"). I use a
"Lead" form to add and edit the lead information (which happens to be
only a small part of the information used in a potential order) and
this goes into the "Orders" table. When a lead turns into a sale,
I've built a macro (button-activated from the "Lead" form) to open the
"Process Sale" form so I can enter the rest of the sale information
into the "Orders" table.

Every order has an autonumber ID (which is the primary key) which is
stored in the "OrderID" field. How can I program the macro to go to
the same record in the "Process Sale" form that I was viewing in the
"Lead" form?

I'm using the OpenForm action to open the "Process Sale" form, but I'm
stuck right there. How do I tell it to go the same record I was just
looking at in the "Leads" form?

Thanks in advance,

Eric Gillis
 
K

Ken Snell \(MVP\)

Use the WHERE argument of the macro to pass the value of the first form's
primary key field to the second form when it opens:

Where: [OrderID] = [OrderID]
 
E

Eric Gillis

Use the WHERE argument of the macro to pass the value of the first form's
primary key field to the second form when it opens:

Where: [OrderID] = [OrderID]
--

Ken Snell
<MS ACCESS MVP>


I'm building a database to process sales leads and orders. Data from
the leads AND orders are stored in the same table ("Orders"). I use a
"Lead" form to add and edit the lead information (which happens to be
only a small part of the information used in a potential order) and
this goes into the "Orders" table. When a lead turns into a sale,
I've built a macro (button-activated from the "Lead" form) to open the
"Process Sale" form so I can enter the rest of the sale information
into the "Orders" table.
Every order has an autonumber ID (which is the primary key) which is
stored in the "OrderID" field. How can I program the macro to go to
the same record in the "Process Sale" form that I was viewing in the
"Lead" form?
I'm using the OpenForm action to open the "Process Sale" form, but I'm
stuck right there. How do I tell it to go the same record I was just
looking at in the "Leads" form?
Thanks in advance,
Eric Gillis

Just what I needed. Thanks!
 

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