I have a form with some part search fields and a subform that shows part info. this subform already has a linked subdatasheet.
From this form, after searching for and selecting a part, a function button then opens a popup window which shows every job that part has been used on.
As this is a table of every part from every job ever done, it is quite large and takes a while to query (about 30-60s).
The issue I'm having right now is that the function button opens the popup form and loads the subform/query.
I then set the search field of this popup form to the part I want to look at, and requery.
this results in a nearly 2 minute load time for this form.
Is there any way I can keep the subform from loading with the popup form?
Or can I put a VBA variable into the query for the subform from within the function button's code, so it is querying the correct info from the start?
Function button code:
Code:Private Sub btnShow_Where_Used_Click() Dim tempPartNo As String tempPartNo = [Parts_Search_Query_Advanced subform].Form.NEC_Part_No DoCmd.OpenForm "Where_Used_Popup_Form" [Forms]![Where_Used_Popup_Form].[input_NEC_PN] = tempPartNo [Forms]![Where_Used_Popup_Form].[Where_Used_Popup_Query_subform].Requery End Sub