need report help! thanks guys - simple i am sure for you!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey - i have a button on a form that opens a report. when i click that
button it seems as tho the report gets printed!
i want to open a report by clicking a button without printing - just view on
screen.
is that possible?
thanks!
 
sbshelp said:
hey - i have a button on a form that opens a report. when i click that
button it seems as tho the report gets printed!
i want to open a report by clicking a button without printing - just view on
screen.
is that possible?
thanks!

Look at the code for your button. It will be using the OpenReport method of
DoCmd. The second (optional) argument for that method controls this. It
defaults to acViewNormal. You need to use acViewPreview instead.
 
Yes, it is. Here are a couple of examples:

Unfiltered report:
DoCmd.OpenReport ReportName:="rptEmployees", View:=acPreview

Filtered report:
DoCmd.OpenReport ReportName:="rptEmployees", View:=acPreview, _
WhereCondition:="EmployeeID = " & Me.cboSelectEmployee


where "rptEmployees" is the name of the report, and "cboSelectEmployee" is
the name of a combo box on the form, for the filtered report. Make the
appropriate substitutions.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

:

hey - i have a button on a form that opens a report. when i click that
button it seems as tho the report gets printed!
i want to open a report by clicking a button without printing - just view on
screen.
is that possible?
thanks!
 
Here is the code for behind your button:

Dim stDocName As String

stDocName = "rptReportName"
DoCmd.OpenReport stDocName, acPreview
 

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

Back
Top