Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old November 2nd, 2007, 03:24 AM
Registered User
 
Join Date: Oct 2007
Location: Gujrat, , Pakistan.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to pass parameters to MS Access report

Dears

         I am facing a problem, which is highly disturbing me. I am
developing a package for an organization using VB6 as front end and



MS Access as database.

       I have to prepare reports which are very elaborate. Reports have been designed in Access. There are situations when i have to pass parameters to reports. These parameters are not the fields of datasource of report, but they are month, date parameters of sub queries from where datasource query is bening generated. These parameters have successfully been passed from ACcess, but my problem is that i want user input from VB6 and want to pass it as parameter to Access report.


I ve use docmd which provides an opportunity to enter the where clause, but i can not use it as my parameter does not belong to direc datasoure, but it is part of the subquries , behind.

Is there any way which will help me.


Moreover, i want to switch over from Access to Sql Server 2000. Is there any way in which Access works at the front end and Server on the back end as is the case with Mysql.


waiting anxiously


Murtaz













































































































Asif Murtaz
  #2 (permalink)  
Old November 2nd, 2007, 06:42 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Why did you put so much blank space in this post?

Yes, you can use Access as the front end and SQL Server as the back end. I do that almost exclusively.

If you are using SQL Server, your best bet is to create a stored procedure, and then pass the parameters to the stored procedure.

In your current situation, you say that the fields you want to pass parameters to "are not the fields of datasource of report..." The solution is to MAKE them fields in the datasource, and you can even put them on the report, just set them to Visible = No.

So on your primary query, add the date fields from the secondary query, and them put them on the report. It is curious that they are not on the report if they are parameters of the report. I do something similar and put the fields on as a range in the report header so that the title of the report is "Sales from 10/1/2007 to 10/31/2007" for example. I use two labels and two text boxes. Anyway...

Did that help?


mmcdonal

Look it up at: http://wrox.books24x7.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters to Access Report murtazasif Access VBA 2 November 6th, 2007 12:32 PM
Convert Ms Access report to MS Word doc kite Access 1 October 22nd, 2007 01:45 AM
unable to pass parameters to crystal report ukumawat Crystal Reports 1 May 6th, 2006 09:08 AM
Pass value into Access Report fizzystutter Classic ASP Databases 0 August 20th, 2003 01:18 PM





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