Access VBADiscuss 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
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.