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 September 23rd, 2003, 05:06 PM
Registered User
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reports in VBA

I am working on a project in access 2000 The front end is in VBA and backend in SQL. I have problems with report generation

I want to specify the record source for my report during runtime, since the query uses conditions from the fields of a form.

I am doing something like

dim rt as new report

this doesn't seem to work.Does anyone have suggestions?

Thanks in advance

Old September 24th, 2003, 02:26 PM
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

Take a look at the help for the OpenReport Method and see if it helps. Place an open report button on your form and write this code for the On Click event. The syntax is:
    DoCmd.OpenReport ReportName, View, FilterName, WhereCondition, _
    WindowMode, OpenArgs

The Filter Name or Where Condition will determine what records get put into the report when it opens.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Old September 25th, 2003, 12:51 PM
Registered User
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


I managed to find how to do it. I wrote a stored procedure, whose input parameters are set at runtime...

Thanks anyway:)

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Excel VBA to SQL & back to VBA edesousa Excel VBA 1 June 1st, 2004 02:39 AM
Handling Reports in VBA Ray Pinnegar Access VBA 3 May 23rd, 2004 03:38 AM
Access 2000 VBA Ch 6 Reports form project Nelz BOOK: Beginning Access VBA 1 September 29th, 2003 09:51 AM

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