I have an unbound form (A). The form contains lists boxes that get information from different tables. When the form is opened the lists are populated with various bits of data. The operator will select certain items from the list boxes.
I have a query (Z) that uses the information the operator selects on form (A). This information is listed in the criteria section of the query.
I have a form (B) that is bound to query (Z).
On form (A) I have a command button that will open form (B). This works great.
All data from query Z is displayed.
I created a subform (C) on form (A) that should display the results that appear in form (B). I am not sure how to change the command button code to make this happen. Does anyone have any idea's? I have listed the command code I am currently using.
Private Sub Command34_Click()
On Error GoTo Err_Command34_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "B"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command34_Click
End Sub