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

Refresh Datareport using dataenvironment

Status
Not open for further replies.

giyer555

Programmer
Sep 8, 2003
75
IN
I am using datareports in VB 6 & the datasource is through dataenvironment.

Using command button in a form the user retrieves data through datareport.
My problem is I need to refresh the datareport without closing the application.

For eg: the command button retrieve has the foll code
dim ssql as string
ssql = "select a,b,c,d,e,f from xyz where a = '" & txtpqr.txt & "'
de1.commands(4).commandtext = ssql
datareport.show

Can anyone tell me how do i refresh the datareport everytime the use clicks the command button.
 
Maybe you haved figured out already, but anyway

I use the Command object in the DataEnvironment, I create the object with an especific sql string, say
Code:
select a,b,c,d,e,f from xyz where a = ?
and as you notice the ? means the parameter, in the properties of the object you should find parameter, there you make the necesary adjustments

then set the DataSource to the DataEnvironment and the DataMember to the Command, then in the button's code:
Code:
 DataEnvironment.Command1 txtpqr.txt
 If DataEnvironment.rsCommand1.RecordCount > 0 then
  DataReport1.Show 1
 End If
 DataEnvironment.rsCommand1.Close

It works for me

If it isn't what you were looking for, tell me, maybe i can help you.

David.
 
I wasn't having a pop at you VDavid, I was trying (badly) to point out that this thread had also been posted in another forum on this site. As we all know, multi-posting is a no-no.

Pete Vickerstaff - Hedra Software
 
In that case no problem.
Because I'm new in this forum, I'm not sure how things work here.

See you around,
David.
 
There is a few guidelines for these forums in faq222-2244

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top