當我嘗試執行程序時,出現如「當對象打開時不允許操作」的錯誤。我正在使用vb 6.0和Microsoft Access數據庫。這裏是源代碼「當對象打開時不允許操作」
Private Sub cmdDelete_Click()
dtaOverhead.Recordset.Open "Delete from variable where SWACTFM= " & txtEntry(0).Text & " And SWBUDACT = " & txtEntry(1).Text & " And SWREMFM = '" & txtEntry(12).Text & "' And SWACTRAW = " & txtEntry(2).Text & " And SWBUDRAW = " & txtEntry(3).Text & " And SWREMRAW = '" & txtEntry(13).Text & "' And SWACTWHS = " & txtEntry(4).Text & " And SWBUDWHS = " & txtEntry(5).Text & " And SWREMWHS = '" & txtEntry(14).Text & "' And SWACTLAB = " & txtEntry(6).Text & " And SWBUDLAB = " & txtEntry(7).Text & " And SWREMLAB = '" & txtEntry(15).Text & "' And SWACTWORK = " & txtEntry(8).Text & " And SWBUDWORK = " & txtEntry(9).Text & " And SWREMWORK = '" & txtEntry(16).Text & "' And SWACTTOTAL = " & txtEntry(10).Text & " And SWBUDTOTAL = " & txtEntry(11).Text & " And SWREMTOTAL = '" & txtEntry(17).Text & "'"
MsgBox "Record deleted successfully !", vbInformation, "Deletion Successful"
Call Filllist
Call clearall
cmdSave.Caption = "&Save"
End Sub
請始終使用'{}'按鈕格式化您的代碼。哪一行失敗?您正在調用兩個過程,如果其中一個過程中的代碼失敗,請發佈該過程的代碼。您可以使用F9設置斷點。使用F8遍歷代碼並找到失敗的行。 – Fionnuala 2012-04-18 09:32:45
對不起,你能解釋一下我認爲我有的那個 – user692495 2012-04-18 09:41:49
的細節。你不明白哪部分? – Fionnuala 2012-04-18 09:58:07