0

I am trying to update some records.The moment the line Adodc2.Refresh executes, I get an error message saying that the "Operation is not allowed when the object is closed" Yet, when I put "On Error Resume Next", it updates the records as I want it to. Please help me thank you..

Here is my code:

Dim intResponse As Integer
    intResponse = MsgBox("Are you sure you want to delete Status?", _
    vbYesNo + vbQuestion, _
    "Clinic System")
    If intResponse = vbYes Then
    Adodc2.CommandType = adCmdText
    Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\clinic.mdb" & ";Persist Security Info=False"
    Adodc2.RecordSource = "UPDATE patients Set Status = Null WHERE Status is not null"
    MsgBox "Record Deleted!", vbInformation, "Clinic System"
    Adodc2.Refresh
    Adodc1.Refresh
    End If
3
Contributors
2
Replies
18
Views
3 Years
Discussion Span
Last Post by Aslam Mansoor
0

You are talking about Update Records, but there is no such coding Adodc1.Recordset.Update or Adodc2.Recordset.Update
Also, if you need to Delete 1 or more records, it is not written the relevant coding for deleting. Hope you have got it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.