|
以前使用的好好的方法,现在不行了,提示如下:
ERROR:3251 这种对象类型不支持该操作。
原代码如下:
Private Sub 删除_Click()
'On Error GoTo DelReport:
Dim bbmc As String
bbmc = Me.报表框
If MsgBox("确实要删除[" & bbmc & "]吗?该删除不可逆转,请再次确认!!!", vbDefaultButton2 + vbYesNo + vbQuestion, MainTile) = vbYes Then
Else
Exit Sub
End If
Dim info As Recordset
Set info = CurrentDb.OpenRecordset("reportname")
info.FindFirst ("报表名称='" & bbmc & "'")
info.Delete
Set info = Nothing
Me.报表框.Requery
Dim rn As String
rn = CurrentProject.Path & "\report\copy\" & bbmc & ".xls"
Kill rn
'DelReportExit:
' Exit Sub
'DelReport:
' MsgBox Error, vbInformation, MainTile
' Resume DelReportExit
End Sub
|
|