I want my report to print from a form that I filter using an opti.

C

CJ

I want my report to print from a form, after I have filtered that form using
an option button. For Instance, my option button has filtered my form to
show only records that shows "Resigned" employees from my employee table. I
then have a preview report command button, and I want my report to show only
the Resigned employees as shown filtered in the form. Likewise, when I use
the option button to show "terminated" employees, my report should also show
only these. My report is run on a query. Please tell me what I can use to
show my filtered records on my report. thank you!
 
R

Richard via AccessMonster.com

CJ

If you want to print the record in the filterd form then put something like
this behind your print button.

Private Sub cmdPrint_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub


http://allenbrowne.com/casu-15.html

HTH
Richard
 

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