I have a button on a form - frmOrders - which opens a popup form - frmDeliveryDetails. A relationship exists between the two via the OrderID field. I want this button to open the frmDeliveryDetails at the appropriate record according to that displayed when the button is clicked. At the moment the right OrderID is displayed, but the other fields, Address, Post Code, etc, on the popup form do not appear.
The code I am using at the moment is as follows:-
Private Sub btnCheckDelAddress_Click()
On Error GoTo Err_btnCheckDelAddress_Click
Dim stDocName As String
stDocName = "frmDeliveryDetails"
DoCmd.OpenForm stDocName, , "[OrderID]=" = Me!OrderID, acFormEdit
Exit_btnCheckDelAddress_Click:
Exit Sub
Err_btnCheckDelAddress_Click:
MsgBox Err.Description
Resume Exit_btnCheckDelAddress_Click
End Sub
Any help would be greatly appreciated.
The code I am using at the moment is as follows:-
Private Sub btnCheckDelAddress_Click()
On Error GoTo Err_btnCheckDelAddress_Click
Dim stDocName As String
stDocName = "frmDeliveryDetails"
DoCmd.OpenForm stDocName, , "[OrderID]=" = Me!OrderID, acFormEdit
Exit_btnCheckDelAddress_Click:
Exit Sub
Err_btnCheckDelAddress_Click:
MsgBox Err.Description
Resume Exit_btnCheckDelAddress_Click
End Sub
Any help would be greatly appreciated.