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

Hello I have a report that runs of

Status
Not open for further replies.

mdctsg

MIS
May 26, 2002
102
0
0
US
Hello
I have a report that runs off my Equipment table. I am trying to run the report based of the serial number. I have a parameter in the report that runs it by serial fine but I need tio do it by Visual.

When I use this

Private Sub LaVolpeButton1_Click()
Dim txtSerial As String <---My text box to input serial #

With frmReports.CR1
.DataFiles(0) = App.Path & &quot;\Database.mdb&quot;
.ReportFileName = App.Path & &quot;\Reports\EQUIPMENT.rpt&quot;
.SelectionFormula = &quot;{EQUIPMENT.SERIAL}=&quot; & Chr(34) & x & Chr(34)
.Action = 1
.PageZoom (89)
End With
The report comes up empty

And when I use
Private Sub LaVolpeButton1_Click()
Dim txtSerial As String <---My text box to input serial #

With frmReports.CR1
.DataFiles(0) = App.Path & &quot;\TSG Database.mdb&quot;
.ReportFileName = App.Path & &quot;\Reports\EQUIPMENT.rpt&quot;
.ParameterFields(0) = &quot;REPSER;&quot; & txtSerial & &quot;;True&quot;
& Chr(34)
.Action = 1
.PageZoom (89)
End With
My .Action = 1 comes back as an invalid parameter

I just need to input the serial number into a text box and run the report. Any help would be appreciated

Thanks
Bob
 
Never mind I found a solution. I wrote a FAQ in hopes of helping someone else who maybe having the same problem

faq 768-4575 in this section. Anyway I went with

Private Sub Command1_Click()

With CR1
.ReportFileName = App.Path & &quot;\Your Report.rpt
.ParameterFields(0) = &quot;Your Crystal Parameter Name;&quot; & Your Text Box Name & &quot;;TRUE;&quot;
.Destination = crptToWindow
.Action = 1
.PageZoom (100)

End With
End Sub

The TRUE stops the Crystal Parameter from prompting the user and allows the use of the textbox as a parameter choice
Check out the faq for more details
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top