Order Button from Customer form

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have a Customer form with a a button at the bottom to place an order,
How do i set the oder button to open the oder form and place the
CustomersID numberautomaticla in the order forms customer ID box

Thanks

Simon
 
This event procedure in the Click event procedure of your command button
should give you the idea:

Private Sub cmdOrder_Click()
If Me.Dirty Then 'Save first.
Me.Dirty= false
End If
If Me.NewRecord Then 'Check there is a customer.
MsgBox "Enter the client before ordering."
Else
DoCmd.OpenForm "frmOrder"
With Forms("frmOrder")
.SetFocus 'In case it was already open.
If Not .NewRecord Then
RunCommand acCmdRecordsGotoNew
End If
!CustomerID = Me.CustomerID
End If
End If
End Sub
 
Back
Top