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!

Selecting multiple fields in Crystal report

Status
Not open for further replies.

joshidharmesh

Programmer
Dec 8, 2017
5
0
0
IN
Hi,

Can I pass multiple selection parameters when calling a crystal report? I am writing following lines

Private Sub PrintTicket(Sr_No As Integer, Class As String, Show As String)
With Form1.Ticket
.DataFiles(0) = App.Path & "\Database\MPlex.mdb"
.ReportFileName = App.Path & "\Reports\Ticket.rpt"
.SelectionFormula = "{Booking.SrNo} = " & Sr_No & " & "{Booking.Class} = " & class &" & "{Booking.ShowName} = " & show &""
.UserName = "Admin"
.Password = "n44d931" & Chr(10) & "n44d931"
.Action = 1
End With


End Sub

I am getting error "Invalid character" with { of {Booking.Class}

Can someone help?

Thanks

Dharmesh Joshi
 
You are missing the word AND between the criteria. Try something like this:

"{Booking.SrNo} = " & Sr_No & " and {Booking.Class} = " & class &" and {Booking.ShowName} = " & show &""

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top