get the value of textbox and pass to crystal report using vb6
hi guys,
how to get the value from textbox or any other control and use it in crystal reports in vb6 by clicking a button?
the value of the textbox will be used in a sql statement like "Select *from Users Where Username = '" & me.textbox.text & "'" to filter the report. the report will only show the filtered records. :cry:
this report will be displayed in crystal report viewer.
please answer asap, thanks and God Bless! Smile | :):
Re: get the value of textbox and pass to crystal report using vb6
Your not stating what version of Crystal your using but usually you'll need to create a parameter field in the Crystal report called something like @FilterParameter. You then need to edit the RecordFilter Selection in Crystal to account for a value (if any) in the newly created @FilterParameter field.
Then in VB6 code, you access the report, loop through the parameter fields until you find @FilterParameter and assign the value of the textbox to it and then allow the report to show.
Hope that helps.
Barry