Connecting Tech Pros Worldwide Forums | Help | Site Map

how to create parameterized reports in VB6.0 using data report

Newbie
 
Join Date: Feb 2007
Posts: 17
#1: Feb 22 '07
I'm using VB6.0 and i am trying to design a report using data environment such that when i run the report it prompts me for a certain parameter then i can view details corncerning that parameter ie if i enter username XX the report should display details about XX only

Newbie
 
Join Date: Jan 2009
Posts: 1
#2: Jan 6 '09

re: how to create parameterized reports in VB6.0 using data report


QUOTE=sunnysrivastava84;2388133]I'm using VB6.0 and i am trying to design a report using data environment such that when i run the report it prompts me for a certain parameter then i can view details corncerning that parameter ie if i enter username XX the report should display details about XX only/QUOTE
Familiar Sight
 
Join Date: Jan 2007
Posts: 224
#3: Jan 8 '09

re: how to create parameterized reports in VB6.0 using data report


first make another form before opening your report which ask you for input let say name then open your report as you are opening and write the following code in your datatreport

Quote:
If DataEnvironment1.rsyourrecordsetname.State = 1 Then
DataEnvironment1.rsyourrecordsetname.Close
End If
DataEnvironment1.rsyourrecorsetname.Open "select * from tablename where name ='" & yourpromtingformname.usernametxt.text & "' ", yourconnectioname, adOpenStatic, adLockOptimistic
Change names according to your needs.
I think this migth solve your problem
Reply


Similar Visual Basic 4 / 5 / 6 bytes