Open form macro

G

Guest

Hi all

I have an Add Customer form that has the CustomerID, FirstName,LastName, And
PhoneMumber. When that form is filled in, I am using an Open Form macro to
close this form and open the Orders form. When the Orders form opens it is
blank. I can open the combo box, find this new entry, click on it, and it
will fill in the appropriate boxes. My question: Is there any way to have the
form "Orders" open in add mode, and already have the the new customer open
without having to go through the combo box?
 
G

Guest

You could leave the Add Customer form open and set the default value of the
CustomerID control on the Orders form to [Forms]![Add Customer]![CustomerID].
Then, in the Open event of the Orders form, put this:

DoCmd.GoToRecord acForm, Me.Name, acNewRec

This will force the Orders form to start on a new record, but with the
CustomerID box pre-populated.
 
G

Guest

That did it .
Thanks Brian

Brian said:
You could leave the Add Customer form open and set the default value of the
CustomerID control on the Orders form to [Forms]![Add Customer]![CustomerID].
Then, in the Open event of the Orders form, put this:

DoCmd.GoToRecord acForm, Me.Name, acNewRec

This will force the Orders form to start on a new record, but with the
CustomerID box pre-populated.

Ron Weaver said:
Hi all

I have an Add Customer form that has the CustomerID, FirstName,LastName, And
PhoneMumber. When that form is filled in, I am using an Open Form macro to
close this form and open the Orders form. When the Orders form opens it is
blank. I can open the combo box, find this new entry, click on it, and it
will fill in the appropriate boxes. My question: Is there any way to have the
form "Orders" open in add mode, and already have the the new customer open
without having to go through the combo box?
 

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