-
Do any of the Crystal Report gurus know why this works with an Integer but NOT when it's a String?
Dim TestNum As Integer
SurNum = 1
Dim TestName As String
SurName = "This is Report Style # 2!"
With Report1
.CrystalReport1.DataFiles(0) = App.Path & "\test.mdb"
.CrystalReport1.ReportFileName = "\latest.rpt"
.CrystalReport1.Formulas(0) = "startcode = " & TestNum
.CrystalReport1.Action = 1
End With
This will work with TestNum but I get "Error in Formula" if I try it with TestName(a string). Any ideas why? What I'm trying to do is pass the Test Name as a Page Header to the Crystal Report report? ANY help would be greatly appreciated!
-
When you want to use report style #2, try this syntax:
Code:
.CrystalReport1.Formulas(0) = "startcode = '" & SurName & "'"
-
Wow! Thank you both! Scott, I'll remember your advice, BruceG your code worked like a charm! Thanks guys!
-
What's Crystal Reprts used for? :confused:
-
Thom: Glad to be of service.
Sc0rp: CR is used mostly to give VB reporting capabilities for VB database apps (similar to the report-writing feature of Access).