Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection print help

Status
Not open for further replies.

aggeliki23

Programmer
Feb 12, 2007
38
GR
hello all, i relativelly new in vb6.
I have a form that user types values for fields of a table, then another form displays the results if the record/s exist. I also created a data report shows these results and my purpose is to print the datareport. I didn't use data enviroment at all but ado shape statement with code.
My problem is that if recordcount results is greater than 1 i want the user selects the record to print navigated with next or previous command button on my form to the records. I don't know what is better to do.
Would it be better create another report displays the current record of the form results and only this record? How can i do this? The current record would look something like rs.AbsolutePosition. Is it possible to pass the current record into a sql query with code and how?
Or would it be better to select the record to print from the report i created something like
srchInvoiceRep.PrintReport True, rptRangeFromTo, from, to
but how know that "from, to" corresponds to the current record of my form?? Any help will be appreciate.

Thank you
in advanced.
 
You need some sort of a list to show the results if >1, and have the user select the one they want to print.
Or you need to print all results.
 
Thank you SBerthold.
What kind of sort you mean? Alphabetical for example? Do you mean to display the results in a listview control?
And when the user selects the record pass it into the datareport and print it? Something like this?
I don't want to print all results in any case because the recordcount could be a big number for example 20000.
 
Use a listbox, or combobox, or even a flexgrid to show multiple results of a search, and when they select one, show details.

-David
2006 & 2007 Microsoft Most Valuable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
>What kind of sort you mean?

aggeliki23: When I wrote " some sort of a list" as in " that means " some kind of a list", or " some type
 
Thank you very much all.
Is it possible with this way to pass the current record on a data report and print it?
 
That's why I don't use Bound Controls. Makes things too hard.
It's easier in the long run to do things yourself.

Still, you should be able to pass a key to the report, and use that to query the db to find the record you want to report on.

-David
2006 & 2007 Microsoft Most Valuable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
What do you mean to pass a key to the report? A parameter? And how would it get values if you don't use bound controls? I don't understand.
 
I don't use reports, but when you call it, you could add parameters, I suppose. I was thinking of a SQL statement that used the PASS (key) to choose the record.

Usually, doesn't a report show ALL selected rather than just one record? Showing one record would be a screen or form, which contains a textbox for each field.

-David
2006 & 2007 Microsoft Most Valuable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
aggeliki23, I showed you how to create a cloned recordset in this thread: thread222-1339930

You only need to create a cloned recordset, set it's Filter property to the criteria you want, and pass that to the report.
 
I understod both you, Clone is a good idea.
What exactly is a PASS (key) in sql statement? What do you mean a PASS (key)? And how can i use it into a sql statement? Do you have any link or whatever about PASS (key) to understand this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top