|
-
Jun 22nd, 1999, 06:43 PM
#1
Thread Starter
Lively Member
I want to print an Access 97 report in VB6. The report is based on a query which takes one parameter.
At the moment, Access prompts me for the parameter. How can I give the query the value of the parameter using VB code? The value of the parameter is held in a variable which was determined earlier. I don't want any user interaction during this process.
I am using VB6, Access 97, and Jet/DAO.
Thanks in advance.
[This message has been edited by Michael (edited 06-23-1999).]
-
Jun 27th, 1999, 01:17 PM
#2
New Member
hello Michael...
i know...i also new on this but i think i've the answer about your problem. actually i also face the same problem as yours... & i've been looking for the answer at this site...& here is the solution... hope it will help...
Dim accApp=New Access.Application
accapp.openCurrentDatabase(App.Path & "\databasename.mdb")
reportname="yourreportname"
accApp.DoCmd.OpenReport reportname,acViewNormal
accApp.CloseCurrentDatabase
Set accApp=Nothing
-linda-
------------------
..what we have to learn to do
....we learn by doing
-
Jun 27th, 1999, 05:01 PM
#3
Thread Starter
Lively Member
Hi Linda
Thanks for your efforts in trying to solve my problem.
The solution that you suggest works fine if the underlying query has no parameters - I have used it a few times.
The problem arises when the underlying query has a parameter. How do I get the parameter into the query via the report.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|