T
tim johnson
Please, why am I getting an error in the procedure below.
"No value given for one or more of the parameters"
strSQL, cnn and rst are public variables in a module so I
do not need to declare then in procedure
Private Sub Form_Load()
strSQL = "SELECT Sum(LettersSent) AS SumOfLettersSent,
Sum(Gross) AS SumOfGross " & _
"FROM tblCallsMade " & _
"WHERE BDCRepID = " & Forms!frmReport!BDCRepID & _
" AND DateCalled Between Forms!frmReport!StartDate
AND Forms!frmReport!EndDate"
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open strSQL, cnn, adOpenKeyset, , adCmdText
MsgBox rst!SumOfLettersSent
End Sub
"No value given for one or more of the parameters"
strSQL, cnn and rst are public variables in a module so I
do not need to declare then in procedure
Private Sub Form_Load()
strSQL = "SELECT Sum(LettersSent) AS SumOfLettersSent,
Sum(Gross) AS SumOfGross " & _
"FROM tblCallsMade " & _
"WHERE BDCRepID = " & Forms!frmReport!BDCRepID & _
" AND DateCalled Between Forms!frmReport!StartDate
AND Forms!frmReport!EndDate"
Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
rst.Open strSQL, cnn, adOpenKeyset, , adCmdText
MsgBox rst!SumOfLettersSent
End Sub