On your switchboard, or other form, add a textbox called txtOrderID;
Next to it, add command button to open the orders form; follow the
wizard steps to do it for you. Then display the properties window for
the command button, select tab Event, put the cursor in the Click event
(where it reads [Event Procedure]) and click on the little button with
the ellipsis symbol on the right. You will be taken to the VBA editor,
and see the code already there, looking something like:
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "CalForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
All you need to do is add this line of code:
stLinkCriteria = "[OrderID] = " & Me.txtOrderID
right before the DoCmd.OpenForm line. I have assumed the name of the
order number field in the orders table to be OrderID, change to the
actual name if different.
HTH,
Nikos