I am building a report using VBA. The report is generated from a cross tab query. So far I have got the detail part organized. Now I am trying to enter totals in the Report footer.
The code that follows fails where I try to establish the value of var2. The message I get is error 3075 missing operator. Can anyone tell what I am doing incorrectly?
Set qdf = db.QueryDefs![qrybymonth_crosstab]
SetUpReportNet ‘Calls up template for report
var = qdf.Fields.Count ‘how many fields in the query
‘Set up fields in report
For n = 0 To var – 1
var1 = qdf.Fields(n).Name ‘Gets name of field
Set ctlText(n) = CreateReportControl(Reports(0).Name, acTextBox, acDetail, , var1, l, 0, w, 300)
l = l + w
w = 800
Next
‘Enter totals
l = 2880
Dim var2 As Currency
For n = 1 To var – 1
var1 = qdf.Fields(n).Name
var2 = DSum(var1, “qrybymonth_crosstab”)
Next n
Regards
Mitch