how do I apply a filter to a command button then open a report

P

Pedders

From A command button, I want to filter on a query and then open or preview a
report and print the results, i will have a few buttons on the same form
runing from the same query but runing a diffrent query and the same report.
 
D

Duane Hookom

You can create the command button using the wizard. Then modify the code to
look like:

Dim strWhere as String
strWhere = "[SomeField]= 'some value'"
DoCmd.OpenReport "rptSomeReport", , , strWhere
 

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