My access database opens with a search form that allows the user to enter multiple criteria into various fields. A command button then builds a filter based on the user’s choices and displays matching records in a list box on a subform. The On Click code is:
Private Sub btnSearch_Click()
' Update the record source
Me.frmsubResults.Form.RecordSource = "SELECT * FROM qryBizMax " & BuildFilter
' Requery the subform
Me.frmsubResults.Requery
End Sub
The record source of the subform is:
SELECT * FROM qryBizMax;
(it works great up to here. I have no idea how, except that the code in the record source changes with each new search. Crazy.)
I want the user to be able to generate a report of the resulting data. The problem is, the subform is the Access equivalent of a one-way, dead-end street. The record source of the report cannot be the subform, nor can it be the query, because the user choices are applied in the filter.
I am open to any suggestions.
Private Sub btnSearch_Click()
' Update the record source
Me.frmsubResults.Form.RecordSource = "SELECT * FROM qryBizMax " & BuildFilter
' Requery the subform
Me.frmsubResults.Requery
End Sub
The record source of the subform is:
SELECT * FROM qryBizMax;
(it works great up to here. I have no idea how, except that the code in the record source changes with each new search. Crazy.)
I want the user to be able to generate a report of the resulting data. The problem is, the subform is the Access equivalent of a one-way, dead-end street. The record source of the report cannot be the subform, nor can it be the query, because the user choices are applied in the filter.
I am open to any suggestions.