Z
zeta
I am trying to run the following Sub that builds a sql
statement and opens a report based on the argument "Num"
fed to it when the user clicks a button. The string can
only hold 250 characters, not enough for the sql
statement. Is there a way around this?
Thanks
zeta
Sub EFactor(Num)
Dim SQLstatement As String
SQLstatement1 = "SELECT DailyAvg" & Num & ".Date,
FormatNumber([AvgOf"
SQLstatement2 = SQLstatement1 & Num & "_CO],2) AS CO,
FormatNumber([AvgOf"
SQLstatement3 = SQLstatement2 & Num & "_O2],2) AS O2,
FormatNumber([AvgOf"
SQLstatement4 = SQLstatement3 & Num & "_StackTemp],2)
AS StackT, FormatNumber([CountOfDate],0) AS Minutes,
FormatNumber([PercentCapture],2) AS DataCapture, E_Calc
([Avgof"
SQLstatement5 = SQLstatement4 & Num & "_StackTemp],
[Avgof"
SQLstatement6 = SQLstatement5 & Num & "_CO],[Avgof"
SQLstatement7 = SQLstatement6 & Num & "_O2]) AS E,
FormatNumber(([E]*15.308),2) AS ER FROM DailyAvg"
SQLstatement = SQLstatement7 & Num & ";"
DoCmd.OpenReport "E_report",
acViewPreview, , "SQLstatement"
End Sub
statement and opens a report based on the argument "Num"
fed to it when the user clicks a button. The string can
only hold 250 characters, not enough for the sql
statement. Is there a way around this?
Thanks
zeta
Sub EFactor(Num)
Dim SQLstatement As String
SQLstatement1 = "SELECT DailyAvg" & Num & ".Date,
FormatNumber([AvgOf"
SQLstatement2 = SQLstatement1 & Num & "_CO],2) AS CO,
FormatNumber([AvgOf"
SQLstatement3 = SQLstatement2 & Num & "_O2],2) AS O2,
FormatNumber([AvgOf"
SQLstatement4 = SQLstatement3 & Num & "_StackTemp],2)
AS StackT, FormatNumber([CountOfDate],0) AS Minutes,
FormatNumber([PercentCapture],2) AS DataCapture, E_Calc
([Avgof"
SQLstatement5 = SQLstatement4 & Num & "_StackTemp],
[Avgof"
SQLstatement6 = SQLstatement5 & Num & "_CO],[Avgof"
SQLstatement7 = SQLstatement6 & Num & "_O2]) AS E,
FormatNumber(([E]*15.308),2) AS ER FROM DailyAvg"
SQLstatement = SQLstatement7 & Num & ";"
DoCmd.OpenReport "E_report",
acViewPreview, , "SQLstatement"
End Sub