I need to update records in a table when clicking on a button.
I have a onclick event which declares my variables and passes these to a Recordset. This function produces the following error; "ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed."
I have included my script below. Hope someone can assist.
Sub btnUpdate_onclick()
Dim sSQL, sCriteria, sName, sCell, sSpeed
Criteria=lbxUpdate.getValue(lbxUpdate.selectedIndex)
sName=txtUpName.value
sCell=txtUpCell.value
sSpeed=txtUpSpeed.value
sSQL="UPDATE Cell SET NAME = '" & sName & "', CELLNO = '" & sCell & "', SPEEDDIAL = '" & sSpeed & "' WHERE (NAME = '" & sCriteria & "')"
rsUpdate.setSQLText sSQL
rsUpdate.open()
End Sub
I have a onclick event which declares my variables and passes these to a Recordset. This function produces the following error; "ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed."
I have included my script below. Hope someone can assist.
Sub btnUpdate_onclick()
Dim sSQL, sCriteria, sName, sCell, sSpeed
Criteria=lbxUpdate.getValue(lbxUpdate.selectedIndex)
sName=txtUpName.value
sCell=txtUpCell.value
sSpeed=txtUpSpeed.value
sSQL="UPDATE Cell SET NAME = '" & sName & "', CELLNO = '" & sCell & "', SPEEDDIAL = '" & sSpeed & "' WHERE (NAME = '" & sCriteria & "')"
rsUpdate.setSQLText sSQL
rsUpdate.open()
End Sub