Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 25th, 2003, 07:20 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to joshua_mccrea Send a message via MSN to joshua_mccrea
Default Auto Filter Reports

I realize that this may be a simple task, however I've not worked with Access much and am having trouble using drop boxes from a form to Filter a Report. The code is

    DoCmd.OpenReport "State_Safety_Workplan_Report", acViewPreview
    With Report_State_Safety_Workplan_Report.Report
        .Filter = "[Cost]=" & idCost
        .FilterOn = True
    End With

where idCost is just a variable with either L,M,or H in it. When I press the command button that this is tied to it opens the report and then prompts me with a dialog box and the text in the dialog box is whatever idCost is. I'm not sure what the correct code is but any help with what the correct code is would be very much appreciated.

 
Old August 25th, 2003, 11:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Try something like this:
Code:
DoCmd.OpenReport "State_Safety_Workplan_Report", acPreview, , "[Cost] = " & idCost
Note the two commas in a row before the WHERE condition.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Refresh and Auto Delete deontae45 VB.NET 2002/2003 Basics 1 September 29th, 2006 04:53 PM
how to get reports in crystal reports using ASP3.0 candy133 Classic ASP Basics 2 January 26th, 2006 08:26 AM
Comparitive Reports in Crystal Reports tarunm Crystal Reports 1 January 21st, 2006 01:08 AM
comparision among crystal reports and Data reports avats Crystal Reports 0 April 13th, 2005 01:01 PM
How to create/design reports with crystal reports BassmaniaQ Crystal Reports 0 December 14th, 2004 04:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.