report that shows information on screen in a form

  • Thread starter Thread starter delfearo
  • Start date Start date
D

delfearo

Hi, i was hoping that someone could help me.

Is there a way for a report to show only the information
that is currently displayed on a form on screen.

When im in a form and apply various filters and then click
on my preview report button, insted of displaying the
information that i have filtered it displays all of the
information in the unfilterd form.

in this form there is not one filter that i always apply.

thanks in advance anyone
 
To apply whatever filter the form has to the report, use this in the Click
event procedure of your Preview button:

Private Sub cmdPreview_Click()
Dim strWhere As String

If Me.FilterOn Then
strWhere = Me.Filter
End If

DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End Sub
 
Back
Top