Creating a form to open up a diffrent form

S

skulmat

I am trying to create a form that will have a couple of choices, one will be
a command button to "create a new order" and that will open up a diffrent
form in the "add mode"
and a difrent buttom will have aplace for me to type in an order number and
then I click the button, and it will open that particular order in a "edit
mode". How would be the way for me to program the buttons and do this?
 
B

Bill Edwards

To open "frmNewOrder" to a blank record:

DoCmd.OpenForm "frmNewOrder", acNormal, , , acFormAdd

Do open "frmEditOrder" to edit the order whose Order Number equals the order
number you entered into the txtOrderNumber text box control (assuming Order
Number is numeric and not alphanumeric):
:
DoCmd.OpenForm "frmEditOrder, acNormal,, "OrderNumber = " &
me.txtOrderNumber,acFormAdd
 
Top