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

Using Data Environment and Data Report 1

Status
Not open for further replies.

mansukh20

Programmer
Mar 11, 2004
14
0
0
GB
Hi Guys,

I am trying to print the customer records on for one of my tables. Rather than printing all the records, how can i implemented a set of codes to print the selected records identified by a primary key. The selection is done using a DataCombo control.

Manny
 
Data Reports work through a Recordset! Therefore you have to create a recordset with the required fields then set it to the datareport's datasource! What you can do is when choosing the cusotmers set a flag in the table, then select all the records having the flag set to true to a recordset and set the datareport!

Hpoe i gave a small idea!!

nick
 
Im sorry to be a pain but have you got an example of a coding. As i usually understand beta by looking at a given code and adapt it to my example.

Manny
 
Ok (ps I hope i'm not helping in any school work...not allowed...don't worry :>)

So here it goes...roughly this is what i'll do:

1) first i create a new field within the table customers call it 'Report' and set it as data tpye Boolean and default as false

2) Then in VB create a form with a List box or combo as you wish, which will be populated with the customer's names and set the value as their unique ID (autonumber etc).

3) Teh user should select a user from teh combo box and using either drag and drop or double click or just a plain command button that says "Choose". This button's fucntion should run a query which will update that client's record "Report" field to true.

4) After he has chosen all the records the user will just run the report. Whitin the report there should be something like this: (in the datareports initialize event)

with RS 'Where Rs is of type recordset
.open "select * from Customers where Report = -1", connection (notice -1 stands for true)

set datareport1.datasource = rs
end with


5) There you go, the report should show all those who were selected. After that you have to refresh the whole table setting all the record's field Report to false!


Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top