Preview Specific Report

  • Thread starter Thread starter Greg Ripper
  • Start date Start date
G

Greg Ripper

Posted this on the form forum. OOpps Sorry.

I am using this onclick event with and id field to get a report to preview.


Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptInfo"

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

Can someone explain to me why this doesn't work? I get an error message:
A problem occurred when Access was communicating with the OLE Server.

What does that mean?

Thanks As Always,
Rip

Rip
 
Greg said:
I am using this onclick event with and id field to get a report to preview.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptInfo"

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

Can someone explain to me why this doesn't work? I get an error message:
A problem occurred when Access was communicating with the OLE Server.

What does that mean?


Sorry, but I have no idea what that error means.

However, you do have the OpenReport line somewhat messed up.
Try this instead:

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
 
Back
Top