VB 6.0 - Data report problem
Asked By Ralph Acido on 27-Jan-06 08:52 PM
Helo.. i have a problem regarding data report.. can anyone has a knowledge how to display these data on a data report? coming from two tables(Students table and Grades table)... here are my data:
Aceret, Michael B.
Subject Code Grade
Acob, Ryan B.
Subject Code Grade
Tank you in advance..
Data report problem
Asked By mariz astodillo on 27-Jan-06 11:09 PM
hey may I know the fieldnames of your tables so i can give u the exact syntax that u may use to retrieve data from the 2 tables. U may use select and left outer join statements here.
select * from student a
left outer join grade b
DataReport and 2 Tables/AddChild Command
Asked By John Conway on 28-Jan-06 12:26 AM
How to: Add a Data Report
1. Go to Project -scroll down to More Activex Designers and click Data Environment
You'll get a window that will say Data Environment1 and just below that you'll see Connection1
2. Right click on connection1. You'll get a Data Link Properties window- Choose Microsoft Jet 4.0 OLE DB Provider and click next
3 You'll see another prompt appear. Go to Select or enter a database name - choose your databse
4. Test the connection then press OK
5. Right Click on connection1 again and Choose ADD COMMAND
6. Right click on command and click properties
7. Change the command1 name to one of your table names (you can leave the name as command1 if you wish) for easy identification
8.Look down and you'll see Source of Data- Change Database Object to TABLE and the Object Name to one of your tables you wish to write a report on and click APPLY and OK
9.Now to add your other table so it can be viewed in the report: Go to Command1 or what ever you'd named it - right click and select Add Child Command.
10. Right Click on the new Command and and select properties.
11. Change the Database Object to Table and Object Name to your other Table name.
12.Now select the Relation tab. Check Relate to a Parent Command Object and where you see Parent Command just select your first table.
13.Go to Realtion Definition and you'll see Parent Fields and Child Fields/Parameters. Both field should be the same (related ID's) Such EmployeeID/EmployeeID.... Click add and you'll see something like EmployeeID to EmployeeID or whatever your fields may be.Click appy and OK
14. Now go to Project and Click Add Data Report
15. Go to properties window to the right and you'll see Data Source- Choose DataEnvironment1 ---- look above and you'll DataMember - Choose (command1) or what ever you had chosen earlier.
16. Now go to your datareport form and right click. Choose Retrieve Structure and then Click Yes
17.ALMOST THERE. With Both your DataReport and DataEnviornment windows open
You should see a + next to the word command1 (or what ever you had chosen earlier)
18 . Place your mouse pointer onto the +Command1( or you know) press and hold- now just drag over onto the Bar that reads DETAIL(Command1_Detail) and let it go
19.Repeat step 18 to place for Command2
20. Last step or 2.
Place a command button on your form. Double click the commandbutton to bring up the code window.
21 Last step. Type ..... DataReport1.Show
Private Sub Command1_Click()
ps . You'll need to experiment as to the structure of your layout in the report.
siva kumar replied to John Conway on 26-Oct-09 04:43 AM
Ok. My Question How to vb data report mouse scrolling