Oh thanks!
Thats just what I needed.
I'm still getting a compile error however.
I altered the code with my value names and get this:
Code:
Private Sub Command144_Click()
On Error GoTo Err_Command144_Click
DoCmd.OpenForm "Order Details Input", , , , acFormAdd
Forms!Order Details Input!Order ID = Me.Order ID
Exit_Command144_Click:
Exit Sub
Err_Command144_Click:
MsgBox Err.Description
Resume Exit_Command144_Click
End Sub
I keep getting a syntax error "Expect =" on this line:
Forms!Order Details Input!Order ID = Me.Order ID
I'm not sure why. I'm sure the names are right as the main form is called Orders and the sub form is called Order Details Input.
Then I'm copying the field Order ID to Order ID on the sub form.
Have I done something wrong there?