report that shows information on screen in a form

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
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top