The following expression works on a report.
Me.Text18.ControlSource = "=Int((Sum([qryAllFieldsForReports]![TotalCount]-[qryAllFieldsForReports]![RandomCount])/(Sum([qryAllFieldsForReports]![TotalCount]))*100))"
What I want to know is how to change the query on which the expression is based. I tried to subsitute the following for these parts "[qryAllFieldsForReports]![TotalCount]" and "[qryAllFieldsForReports]![RandomCount]" with no luck.
sqltest = "SELECT qryAllFieldsForReports.* FROM qryAllFieldsForReports WHERE (((tblLogDetail.Date) Between #" & SQLdate & "# And #" & SQLdate2 & "#))"
In the end I want to be able to do this:
Me.Text18.ControlSource = "=Int((Sum([" & sqltest & "]!TotalCount -([" & sqltest & "]![RandomCount])/(Sum(([" & sqltest & "]!TotalCount))*100))"
Any suggestions on how I can make this work?
Me.Text18.ControlSource = "=Int((Sum([qryAllFieldsForReports]![TotalCount]-[qryAllFieldsForReports]![RandomCount])/(Sum([qryAllFieldsForReports]![TotalCount]))*100))"
What I want to know is how to change the query on which the expression is based. I tried to subsitute the following for these parts "[qryAllFieldsForReports]![TotalCount]" and "[qryAllFieldsForReports]![RandomCount]" with no luck.
sqltest = "SELECT qryAllFieldsForReports.* FROM qryAllFieldsForReports WHERE (((tblLogDetail.Date) Between #" & SQLdate & "# And #" & SQLdate2 & "#))"
In the end I want to be able to do this:
Me.Text18.ControlSource = "=Int((Sum([" & sqltest & "]!TotalCount -([" & sqltest & "]![RandomCount])/(Sum(([" & sqltest & "]!TotalCount))*100))"
Any suggestions on how I can make this work?