Sub Chkbx_click
basestring = Sender
newstring = StrReplace(basestring,"chkbx","")
newactionname = Control("btn" & newstring).text
If Control("chkbx" & newstring).checked = True Then
newactionused = "True"
Else newactionused = "False"
End If
Connection.BeginTransaction
Command.AddParameter("ActionName")
Command.SetParameter("ActionName", newActionname)
Command.AddParameter("ActionUsed")
Command.SetParameter("ActionUsed", newActionused)
Command.CommandText = "UPDATE Actions SET Action_Used=@ActionUsed WHERE Action_name=@ActionName"
Command.ExecuteNonQuery
Command.CommandText="SELECT action_name, Action_used FROM Actions WHERE Action_Name=@ActionName"
'Fetch data
reader.New1
Reader.Value = Command.ExecuteReader
Connection.EndTransaction
Msgbox(reader.GetValue(0)& " " & reader.GetValue(1))
reader.Close
End Sub