Hello everyone,
Here it goes..
I have an orders form like the one in Northwind. I put a button on the form that will show a popup form that shows details of the selected product in the orders subform. I have included the following code on the button, but it promps me for the product's ID instead of getting it automatically for me.
Can some one tell me what might be the problem?
Private Sub Popup_button_Click()
On Error GoTo Err_Popup_button_Click
Dim stDocName As String
Dim strLinkCriteria As String
stDocName = "ProductsPopup"
strLinkCriteria = "ProductID = Forms!Orders!OrdersSubform!ProductID"
DoCmd.OpenForm stDocName, , , strLinkCriteria
Exit_Popup_button_Click:
Exit Sub
Err_Popup_button_Click:
MsgBox Err.Description
Resume Exit_Popup_button_Click
End Sub
Thank you in advance... To guess is cheap
To guess wrongly is expensive
Tell me, I may remember
But involve me and I'll understand.
Here it goes..
I have an orders form like the one in Northwind. I put a button on the form that will show a popup form that shows details of the selected product in the orders subform. I have included the following code on the button, but it promps me for the product's ID instead of getting it automatically for me.
Can some one tell me what might be the problem?
Private Sub Popup_button_Click()
On Error GoTo Err_Popup_button_Click
Dim stDocName As String
Dim strLinkCriteria As String
stDocName = "ProductsPopup"
strLinkCriteria = "ProductID = Forms!Orders!OrdersSubform!ProductID"
DoCmd.OpenForm stDocName, , , strLinkCriteria
Exit_Popup_button_Click:
Exit Sub
Err_Popup_button_Click:
MsgBox Err.Description
Resume Exit_Popup_button_Click
End Sub
Thank you in advance... To guess is cheap
To guess wrongly is expensive
Tell me, I may remember
But involve me and I'll understand.