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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help using DataReport

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I really dont know how to use the data report to well..I know theres not much to it but, what I am trying to do is print a recordset returned by a user. I have a form that opens asking the user for a number using an inputbox. once those records get returned i would like to put behind a command button a print command to print a sheet for each record.

Can someone give me some examples???

I am using SQL2000 and all my connections and recordsets are set in code using ADO.

Thanks dvannoy@onyxes.com
 
i understand that the number that the user enter suppose to be corresponde to one of the fileds in the recordset. if so:
1. you have to add datareport from the project menu.
2.you can put textboxex on the report as you like
3.for each textbox that you put in the detail section you have to put the field name that this textbox should hold in the DataField property of that textbox.
4.in the code of the data report initialize you have to open the recordset:

rs.open "Select * From Employee where EmployeeNum = " & frmOtherForm.txtNumber,con

set datareport.dataSource = rs.Datasource

.....

that's it for the report.

in the command button in the form you have to write datareport.show

i hope it helped
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top