Open form macro

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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?
 
Back
Top