Previewing a report via a command button

DasT

New Member
Joined
Sep 7, 2004
Messages
29
HI!

This ones is probably something obvious but atm i'm stuck..

So far I've got a filter in place using a query which allows the user to select different business sectors for our clients and other criteria, and I need the user to be able to preview a report before printing via a command button button, but so far i've only managed to get it to immediately print using this code:
Code:
Private Sub Command13_Click()

    Dim stDocName As String

    stDocName = "Company contacts1"
    DoCmd.OpenReport stDocName

    
    DoCmd.Restore

Exit_btn_follow_up_actions_Click:
    Exit Sub
    

End Sub

Shouldn't be too hard, right?

cheers!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,221,864
Messages
6,162,497
Members
451,770
Latest member
tsalaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top