Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 20th, 2004, 04:41 AM
Registered User
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to coboy
Default Pass Form Variable to Report (DataReport)

:) Hi all, (using VB 6)

How can include a variable from a FORM into a DataReport print page.
Also ,

How include the varible to the cratria insdie the SQL of the DataRepot.

Old September 22nd, 2004, 12:19 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

Use the DoCmd.OpenReport method. For example, to filter on a text variable,

DoCmd.OpenReport "Your Report Name", acPreviewPrint, , "[Your Table or Query Field] = '" & Me.txtYourTextboxField & "'"

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
To pass value of string variable to another form thillai Visual Basic 2005 Basics 5 March 13th, 2008 03:29 AM
pass session variable to report select where nutrino ASP.NET 2.0 Basics 0 October 25th, 2006 09:16 AM
Pass variable to main form dataset spacky001 ASP.NET 1.0 and 1.1 Basics 2 September 13th, 2006 10:10 PM
How to pass data directly into datareport . baburam VB How-To 1 May 23rd, 2006 03:43 AM
pass form elements variable vickyj Classic ASP Basics 0 October 29th, 2005 04:58 AM

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