<< Click to Display Table of Contents >>
Delete |
In this exercise, let's delete the selected record in the E3Browser. To remove a table's record, use the Delete command.
1.Insert on the Screen a Query object and name it as "DeleteQuery".
2.On the SQL tab, edit the command to the next code.
DELETE FROM ConfigDevice
WHERE Device = '<%Device%>'
3.In the Remove Button, insert the next script.
'Device name
plc = Screen.Item("spDevice").Value
'User confirmation
If MsgBox("Are you sure you want to remove the device '" & _
plc & "'?", vbYesNo + vbQuestion) = vbYes Then
Set delQuery = Screen.Item("DeleteQuery")
delQuery.SetVariableValue "Device", Screen.Item("spDevice").Value
delQuery.Execute()
End If
4.Execute the application and test this new functionality.