Click to See Complete Forum and Search --> : VB Data Report


nakheel
January 20th, 2000, 01:28 AM
I am facing following problems while working with data report(Visual Basic 6)

1. Please tell me how to pass sql to Command Object of dataenviroment at run time.

For example:
Name Age
==== ===
Pavan 12
Pallavi 10
Swati 6
Deepak 35

In case if I want Names where age is less than a number

2. Title for the Data Report

In case if I select all the records where age is less than 20
I want to give title to the report as

List of Names of age less than 20


Please help me.

Dr_Michael
January 20th, 2000, 01:50 AM
I would do it like this way:


private Sub DataReport_Initialize()
'requery recordset
If deYourDataEnvironment.rsYourReturningRecordset.State = adStateOpen then
deYourDataEnvironment.rsYourReturningRecordset.Requery
End If
'display only the desired results
deYourDataEnvironment.rsYourReturningRecordset.Filter = " Age <= 20 "
End Sub

private Sub DataReport_QueryClose(Cancel as Integer, CloseMode as Integer)
While me.AsyncCount > 0
DoEvents
Wend
Unload me
End Sub




Michael Vlastos
Automation Engineer
Company SouthGate Hellas SA
Development Department
Athens, Greece