R
Rajat
Hi,
I am trying to upsize a report whose underlying query
calls several user-defined functions defined in a single
module.
What is the best way to upsize this process to ADP?
Here is an example function in the module:
**************************************
Function GetLaptopCount(strReportClient As String)
Dim db As Database
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT Sum(nz([Volume])) AS LaptopCount,
tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & " " & _
"FROM tblExpenseCodes INNER JOIN
tblCurrentMonth ON tblExpenseCodes.[StdEC] =
tblCurrentMonth.[StdEC] " & _
"WHERE (((tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & ") = '" &
strReportClient & "')) " & _
"GROUP BY tblCurrentMonth.[Sub Product Code],
tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & " " & _
"HAVING (((tblCurrentMonth.[Sub Product Code])
='40200200011'));"
Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly,
dbReadOnly)
If rs.RecordCount = 0 Then
GetLaptopCount = 0
Else
GetLaptopCount = rs![LaptopCount]
End If
' MsgBox GetLaptopCount
rs.Close: Set rs = Nothing
Set db = Nothing
End Function
******************************************
I am trying to upsize a report whose underlying query
calls several user-defined functions defined in a single
module.
What is the best way to upsize this process to ADP?
Here is an example function in the module:
**************************************
Function GetLaptopCount(strReportClient As String)
Dim db As Database
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb()
strSQL = "SELECT Sum(nz([Volume])) AS LaptopCount,
tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & " " & _
"FROM tblExpenseCodes INNER JOIN
tblCurrentMonth ON tblExpenseCodes.[StdEC] =
tblCurrentMonth.[StdEC] " & _
"WHERE (((tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & ") = '" &
strReportClient & "')) " & _
"GROUP BY tblCurrentMonth.[Sub Product Code],
tblExpenseCodes." & Forms!
frmSingleInterface.cboManagerLevel & " " & _
"HAVING (((tblCurrentMonth.[Sub Product Code])
='40200200011'));"
Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly,
dbReadOnly)
If rs.RecordCount = 0 Then
GetLaptopCount = 0
Else
GetLaptopCount = rs![LaptopCount]
End If
' MsgBox GetLaptopCount
rs.Close: Set rs = Nothing
Set db = Nothing
End Function
******************************************