Solved

VB6 DataReport - passing Params

Posted on 2000-02-20
5
323 Views
Last Modified: 2006-11-17
VB6 sp3, Win98

I have created a report that is based on a command within a data environment. This is easy if the command has no parameters, but if params are required, how do you pass the param values to the command ?

TIA

John
0
Comment
Question by:JohnHind
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:MTroutwine
ID: 2539620
Here is an article by Microsoft that describes passing a parameter to a Command object.  It comes with explanation and sample code!

http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbcondataenvironmentprogrammingguidelines.htm
0
 

Author Comment

by:JohnHind
ID: 2540050
I agree that this explains passing params to a data environment, but it does not explain how to do it from a data report.

In the report you select which command to base the report on, but when the report is generated, I cannot see where you would pass the params to the command function....

John
0
 
LVL 12

Accepted Solution

by:
roverm earned 50 total points
ID: 2541441
Just invoke the command first:

DataEnvironment1.Command1 parm1, parm2

then invoke the DataReport:

DataReport1.PrintReport

This works!

D'Mzzl!
RoverM
0
 

Author Comment

by:JohnHind
ID: 2541757
MTroutwine

Yes you were correct but not as clear as roverm. I will send you 25 points if that's possible !

John Hind
0
 
LVL 3

Expert Comment

by:MTroutwine
ID: 2542184
John,

Don't worry about the points, glad to see you got a your problem solved. That's what counts!

:>)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now