Open a Report from a Record form Cmd Btn

G

Guest

I have a form that I would like the user to manage data with. I would also like it set up if a report is needed for the record that the user is on he/she can just click a Cmd Btn that will open the Report that goes with that record

Fm Name: ECC_List_ F
Rpt Name: ECC_Email_Rp

Key ID on both is the ECC_KeyI

Here is the code I'm working with. Still new at this any help would be great!

Thanks
Keit

Private Sub Command106_Click(
Dim stDocName As Strin
Dim stLinkCriteria As Strin

stDocName = "ECC_Email_Rpt

stLinkCriteria = "[ECC_KeyID]=" & Me![ECC_KeyID
DoCmd.OpenReport stDocName, , , stLinkCriteri

End Su
 
R

Rick Brandt

KAnoe said:
I have a form that I would like the user to manage data with. I would also
like it set up if a report is needed for the record that the user is on he/she
can just click a Cmd Btn that will open the Report that goes with that record.
Fm Name: ECC_List_ Fm
Rpt Name: ECC_Email_Rpt

Key ID on both is the ECC_KeyID

Here is the code I'm working with. Still new at this any help would be great!!

Thanks.
Keith

Private Sub Command106_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ECC_Email_Rpt"

stLinkCriteria = "[ECC_KeyID]=" & Me![ECC_KeyID]
DoCmd.OpenReport stDocName, , , stLinkCriteria

End Sub

The above looks fine. Perhaps if you indicated what does or does not happen
when you press the button we could be of more assistance. Do you get...

Nothing?
An error?
A report with the wrong results?
 

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

Similar Threads


Top