If you are familar with Crystal Reports then skip to Part 2
Create your report in Crystal. Insert your parameter. If you are not familar with it go to Insert, select Field Object. Then select Parameter Fields. Next select the new button (Which looks like a page with a yellow star). Give your parameter a name and make sure the value type is String. Then select OK. Then drag the parameter into your report and select close. Next, right click on the parameter and choose Select Expert. If this is your only parameter select the field your parameter will represent. Then select OK. Next in the combo drop down menu select "is equal to". The in the other combo box that appears select your parameter, then ok. That will prompt you for the parameter the next time you refresh
On your form place the Crystal Reports Control, a Text Box and a Command Button Name the Report Control to CR1 or whatever you want.
The same for the textbox. In your Command Button Code
Private Sub Command1_Click()
With CR1 .ReportFileName = App.Path & "\Your Report.rpt .ParameterFields(0) = "Your Crystal Parameter Name;" & Your Text Box Name & ";TRUE;" .Destination = crptToWindow .Action = 1 .PageZoom (100)
End With End Sub
Adding the TRUE to the statement stops the Crystal prompt from appearing allowing you to use your text box as the parameter. I made the mistake of declaring the textbox do don't do that. Don't put the ? that is attached to your parameter in crystal
I hope this will help someone with the same problem. I have seen this question many times.