Hi,
I'm trying remove actual record by this VB code:
Private Sub Command41_Click()
On Error GoTo Err_EditDelBox_Click
Dim rs As Recordset
Dim strBMark As String
Set rs = Forms!Media.Form.RecordsetClone
With rs
Do Until .EOF
.Delete
.MoveNext
Loop
End With
DoCmd.SetWarnings False
RunCommand acCmdDeleteRecord
Exit_EditDelBox_Click:
DoCmd.SetWarnings True
Exit Sub
Err_EditDelBox_Click:
MsgBox Err.Description
Resume Exit_EditDelBox_Click
End Sub
After click I get error message Cannot update database or object is read-only. And record isn't been removed. Well I founded this script on internet.... I'm really not good in VB.
But problem could be somewhere else. I opened form by macro and I couldn't fill some fields in form. It looks like that form is really locked (but subforms are OK). I just used simple macro "OpenForm" and set only Name of form to be opened.
Could anybody helps?
Thanks
I'm trying remove actual record by this VB code:
Private Sub Command41_Click()
On Error GoTo Err_EditDelBox_Click
Dim rs As Recordset
Dim strBMark As String
Set rs = Forms!Media.Form.RecordsetClone
With rs
Do Until .EOF
.Delete
.MoveNext
Loop
End With
DoCmd.SetWarnings False
RunCommand acCmdDeleteRecord
Exit_EditDelBox_Click:
DoCmd.SetWarnings True
Exit Sub
Err_EditDelBox_Click:
MsgBox Err.Description
Resume Exit_EditDelBox_Click
End Sub
After click I get error message Cannot update database or object is read-only. And record isn't been removed. Well I founded this script on internet.... I'm really not good in VB.
But problem could be somewhere else. I opened form by macro and I couldn't fill some fields in form. It looks like that form is really locked (but subforms are OK). I just used simple macro "OpenForm" and set only Name of form to be opened.
Could anybody helps?
Thanks