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

VB6 & CR 8.5 help needed 1

Status
Not open for further replies.

pmaxon

Programmer
Sep 25, 2003
68
US
I have a VB6 application which will pass a parameter called sLName from a combox to a report which I created using CR 8.5. In VB6, I selected "Add Crystal Report" from the menu which created for me a CrystalReport1.DSR and a FORM1. I am using an Access database. My report name is AdjBill.rpt. What code must I add to the FORM1 in order to get this to work? Also, do I only need to view the SQL in my report and add WHERE Adjuster.'Adjuster.Last.Name' = sLName. Ultimately, I need to select a name from my combobox and pass that name to my report and produce my report.

Any help would be GREATLY appreciated! Thanks all!
 
Try it without the GetItemByName method to see if that still gives you an error:

Report.ParameterFields.(1).Value = mLNameParam

-dave
 
Same result... Object Required

I have this in the General section of my Form1

Dim Report As New CrystalReport1
Public mLNameParam As String

and CrystalReport1 is the name of my dsr and formload is:

Private Sub Form_Load()
Report.ParameterFields(1).Value = mLNameParam
Report.EnableParameterPrompting = False
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
 
OK, think I've got it now...

Report.ParameterFields.GetItemByName("sLastName").AddCurrentValue mLNameParam

-dave
 
All that work and now I am back to "Server has not yet been opened"...
 
I am at work now and have tried it here. I do not get the Server error and have changed your suggestion to: Report.ParameterFields(1).AddCurrentValue mLNameParam. The report now displays but contains no data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top