I'm using a query on a form that you open to find a record, then I use a command button to put this information into a subform. The code works the first time opened and then stalls. You have to shut down the form and come back in for it to work again. This is my code, what am I missing or needing to add.
Private Sub Button48_Click()
On Error GoTo Err_Button48_Click
Dim docname As String
Dim LinkCriteria As String
docname = "Master Requisition Form"
LinkCriteria = "[STOCK] = Forms![View Inventory by Stock/TR/PO]![STOCK]"
DoCmd.OpenForm docname, , , LinkCriteria
DoCmd.GoToControl "MASTER REQUISITION SUB FORM"
DoCmd.GoToControl "TR"
DoCmd.FindRecord [Forms]![View Inventory by Stock/TR/PO]![TR]
Exit_Button48_Click:
Exit Sub
It's giving me a headache. Why does it work once and not consecutively. Please help and thank you in advance for your help.
C Fields
Private Sub Button48_Click()
On Error GoTo Err_Button48_Click
Dim docname As String
Dim LinkCriteria As String
docname = "Master Requisition Form"
LinkCriteria = "[STOCK] = Forms![View Inventory by Stock/TR/PO]![STOCK]"
DoCmd.OpenForm docname, , , LinkCriteria
DoCmd.GoToControl "MASTER REQUISITION SUB FORM"
DoCmd.GoToControl "TR"
DoCmd.FindRecord [Forms]![View Inventory by Stock/TR/PO]![TR]
Exit_Button48_Click:
Exit Sub
It's giving me a headache. Why does it work once and not consecutively. Please help and thank you in advance for your help.
C Fields