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

Sending a selection formula to VB for Crystal OCX

Status
Not open for further replies.

evansj42

MIS
Mar 22, 2002
3
0
0
US
How do you pass a selection formula to a report from within VB? I have a report that will not accept my formula, and instead returns all records. I am using SQL Server as the back end, and some of the tables and fields are separated by spaces.

The table.fieldname is:

Active_Ops_View.Responsible Manager/Staff

In SQL Server it would be:
Active_Ops_View.[Responsible Manager/Staff]

Here is my VB code for the formula:

Dim my_formula As String
my_formula = "" + "{Active_Ops_View.Responsible Manager/Staff} = " + "'" + Trim(cboStaff3.Text) + "'" + ""
myReports.ReportFileName = App.Path & "\report1.rpt"
myReports.SelectionFormula = myformula
myReports.PrintReport
pnlManager.Visible = False

Why doesn't this work? I have done this in another report, and it works fine. However, the fields don't have spaces in the other report.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top