Print Report from Current Form

C

channell

Alright, I have a form with a subform on it. On the main form, I can select
different employees, then the Subform displays records for that employee. I
have the code right, I think, because it brings up the report, but it
displays no information. I think I may need some help witht he way the query
is set up. Here is the code I have, but I need some assistance on making it
all work. Thanks!!

Private Sub CommandOpen6135r_Click()
On Error GoTo Err_CommandOpen6135r_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "r6135FOREMAIL"

stLinkCriteria = "[EMPLOYEE ID] = " & Me![EMPLOYEE ID]
DoCmd.Close
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

Exit_CommandOpen6135r_Click:
Exit Sub

Err_CommandOpen6135r_Click:
MsgBox Err.Description
Resume Exit_CommandOpen6135r_Click

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