Run-time error 2001
Hi all,
Right now, I've got a fully-functioning Queries Dialog Box except for one problem. Whenever I cancel out of a parameter query, I get the following error.
Run time error '2001':
You canceled the previous operation
This is the code that gets highlighted when the VBA editor opens(This is after I click on the Debug button)
sub_View_ContAccrl.Form.Filter = dynSQL
sub_View_ContAccrl.Form.FilterOn = True
SQL = "SELECT SUM(View_ContAccrl.hours) AS TotHours, Sum(View_ContAccrl.cost) AS TotCost FROM View_ContAccrl "
SQL = SQL & " WHERE " & dynSQL & ";"
Set rs = CurrentDb.OpenRecordset(SQL, dbOpenSnapshot)
If rs.RecordCount > 1 Then
MsgBox "Unable to calculate sums"
Else
If IsNull(rs.Fields("TotHours")) Then
Me.txtTotCost = Format(0, "$#,##0.00")
Else
Me.txtTotCost = Format(rs.Fields("TotCost"), "$#,##0.00")
End If
Is there any way to keep the above-mentioned error message from EVER popping up again in the future?
Thanks in advance
Kimberley L. Collins
|