Solved

VB6 DataReport - passing Params

Posted on 2000-02-20
5
322 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 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

14 Experts available now in Live!

Get 1:1 Help Now