There are several solutions in Access to open a form on a data set that is a subset of a table, using a criteria. You can:
1. Use the third ("
FilterName") or fourth ("
WhereCondition") parameter of the "
DoCmd.OpenForm" method.
2. Use a query that has a reference to a control from another form in its WHERE clause as the RecordSource property of the form you want to open.
3. Manually change the Filter pproperty of the form once it's open (from "outside", using a parameter passed as "OpenArgs" (7th parameter of the "
DoCmd.OpenForm" method) or retrieving a Public variable or property.
4. Builld a dynamic query or modify the SQL property of a QueryDef object, according to the selection.
5. Probably several other methods that I don't think of at the moment.
Did you encounter a specific problem or are you looking for advices or opinions.
Not knowing your application, my favourite would probably be something like this (air code):
Code:
Private Sub CommandOpen_Click()
Dim strCriteria As String
If Not IsNull(Me.ComboOrg.Value) Then
strCriteria = "Organization = '" & Me.ComboOrg.Value & "'"
DoCmd.OpenForm "Intermediate_Form", , , strCriteria
' Possibly:
'
' DoCmd.OpenForm "Intermediate_Form", , , strCriteria , , acDialog
'
End If
End Sub