Click to See Complete Forum and Search --> : VB 6.0 and data report writer


Stephen Ollinger
March 14th, 1999, 11:50 PM
I have created everything I need to print a report. I have based my report on a data source called datainvoice and a datamember called currentinvoice.


Currentinvoice is defined on a SQL statement (select invoice.* from invoice where invoiceno = ?)


I have defined a parameter in the parameter tab and now need a way to pass an invoiceno to the report before it prints (to print just one invoice that the user selects to print)


How do I pass this parameter to the data report writer so that the sql statement will read (select invoice.* from invoice where invoiceno = 3001) (the invoice that I currently want to print) If I fill in the Value prompt in the Parameter tab all works fine but the report will only print that invoice.


All help docs seem to relate to creating a new query but I want to use my nice report that I created.


Can anyone please help?

Jason Watson
March 16th, 1999, 05:08 PM
The way that I do it is to send the invoiceid to a temp table and have the data source equal a query that matches the invoice.invoiceid to report.invoiceid


Hope that helps

Jason

April 15th, 1999, 10:41 AM
I had a similar issue with a command object within a data environment. I set up two parameters using SQL and the ?. I then called it through code with something like: dataenvironment1.command1 text1.text, text2.text

I hope this helps...

rbandaru
April 27th, 1999, 07:52 PM
<vbcode>
'Asset_view is the dataenvironment
'rs command is the command object created for the 'data environment

If ASSET_VIEW.rsCommand4.State = adStateOpen Then
ASSET_VIEW.rsCommand4.Close
End If
'The command accepts a parameter which i am 'passing from the input box.
Test = InputBox("Please enter the Clock Speed")
ASSET_VIEW.Command4 (test)'query with parameter

CPU_Report1.Show
<vbcode1>