This is my code.
Private Function GetSum(GLORG as String)
Dim rst as Recordset
Dim stSQL as String
stSQL = "Select MonthSum Form CMonthqry Where GLORG='" & GLORG & "'"
Set rst = CurrentDB.Openrecordset(stSQL)
Get GLORG = rst.Field("MonthSum")
End Function
GLORG is a six diget number and CMonthqry is a dallor amount. Can anyone tell me why I'm getting a error message when I run the report?
Private Function GetSum(GLORG as String)
Dim rst as Recordset
Dim stSQL as String
stSQL = "Select MonthSum Form CMonthqry Where GLORG='" & GLORG & "'"
Set rst = CurrentDB.Openrecordset(stSQL)
Get GLORG = rst.Field("MonthSum")
End Function
GLORG is a six diget number and CMonthqry is a dallor amount. Can anyone tell me why I'm getting a error message when I run the report?