Hello -
I have a database with a form with company/contact information. When you click a button, a form with the product (previous orders) information opens up.
My problem is that when you enter new information into the product information form, it will not save because the Company ID field hasn't been filled in. The tables the forms are based on are related, on that field, everything seems correct.
The row source for that control reads as follows:
SELECT [Contacts].[Company ID] FROM Contacts;
The Event procedure for the button that opens the product id form is as follows:
Private Sub Open_Product_Information_Form_Click()
On Error GoTo Err_Open_Product_Information_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Product Information"
stLinkCriteria = "[Company ID]=" & Me![Company ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Product_Information_Form_Click:
Exit Sub
Err_Open_Product_Information_Form_Click:
MsgBox Err.Description
Resume Exit_Open_Product_Information_Form_Click
End Sub
I'd really prefer not to even have the contact id visible on the form, but I definitely don't want users to have to fill it in...
Any suggestions????
Thank you,
Jeannie
I have a database with a form with company/contact information. When you click a button, a form with the product (previous orders) information opens up.
My problem is that when you enter new information into the product information form, it will not save because the Company ID field hasn't been filled in. The tables the forms are based on are related, on that field, everything seems correct.
The row source for that control reads as follows:
SELECT [Contacts].[Company ID] FROM Contacts;
The Event procedure for the button that opens the product id form is as follows:
Private Sub Open_Product_Information_Form_Click()
On Error GoTo Err_Open_Product_Information_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Product Information"
stLinkCriteria = "[Company ID]=" & Me![Company ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Open_Product_Information_Form_Click:
Exit Sub
Err_Open_Product_Information_Form_Click:
MsgBox Err.Description
Resume Exit_Open_Product_Information_Form_Click
End Sub
I'd really prefer not to even have the contact id visible on the form, but I definitely don't want users to have to fill it in...
Any suggestions????
Thank you,
Jeannie