Suppose you have a form which shows certain records and you want a report to show the same records as this form. Suppose further than the criteria making the form show the records it is showing is NOT from a "form filter," but rather is due to the specific RECORDSOURCE of the form, which may be a filter saved as a query which was applied, or due to SQL applied to it. Whatever, these procedures will make it work.
Function IsLoaded(ByVal strFormName As String) As Boolean |
If IsLoaded("browse_all_form") Then Me.RecordSource = Forms!browse_all_form.RecordSource Me.OrderBy = Forms!browse_all_form.OrderBy Me.OrderByOn = True End If |
Note: the bolded lines are optional lines which also makes sure that any sort orders applied to the browse_all form also get applied to the report, too.
I also saved newsgroup messages which I received on this subject in early May 2001. Click here to read them.