S
Steve Newport
Sorry basic question but I am going around in circles.
I have a simple supplier table with Supplier ID as key. I open a new table
with a form in preparation to add a new record in the second table
(Contacts). Form opens OK and you can add entries but I want to copy across
the Supplier ID so that it maintains the relationship. Tried several ways but
cant manage it.
The VB behind the relevant button that opens the form reads:
Private Sub CMD_AddContact_Click()
On Error GoTo Err_CMD_AddContact_Click
Dim stDocName As String
Dim stSupplierID As String
stDocName = "FRM_ContactsAdd"
stSupplierID = SupplierID
DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
Exit_CMD_AddContact_Click:
Exit Sub
Err_CMD_AddContact_Click:
MsgBox Err.Description
Resume Exit_CMD_AddContact_Click
End Sub
Which I have messed around with a bit. How should I be doing this?
Many thanks
I have a simple supplier table with Supplier ID as key. I open a new table
with a form in preparation to add a new record in the second table
(Contacts). Form opens OK and you can add entries but I want to copy across
the Supplier ID so that it maintains the relationship. Tried several ways but
cant manage it.
The VB behind the relevant button that opens the form reads:
Private Sub CMD_AddContact_Click()
On Error GoTo Err_CMD_AddContact_Click
Dim stDocName As String
Dim stSupplierID As String
stDocName = "FRM_ContactsAdd"
stSupplierID = SupplierID
DoCmd.OpenForm stDocName, , , , acFormAdd, , acWindowNormal
Exit_CMD_AddContact_Click:
Exit Sub
Err_CMD_AddContact_Click:
MsgBox Err.Description
Resume Exit_CMD_AddContact_Click
End Sub
Which I have messed around with a bit. How should I be doing this?
Many thanks