Code:
Private Sub some_Click () 'defines the Dim txtSQL As String Dim MsgText As String Dim Online_mrc As ADODB. recordset Dim mrc1 As ADODB. recordset Dim txtStr As String Dim MsgTxt As String Dim mm As String 'when no row is selected, the user is prompted If myflexgrid. rowSel-1 = 0 Then MsgBox "select the row to be down! ", VbOKOnly + vbExclamation," warning "Exit Sub End If 'query txtSQL =" select * from Online_Info "Set Online_mrc = ExecuteSQL (txtSQL, MsgText) in the Online_Info table) mm = Trim (myflexgrid. textMatrix (myflexgrid. rowSel, 0 )) 'Return the value corresponding to the field of the selected row' delete the record with the selected card number in the Online_Info table txtStr = "delete from Online_Info where cardno = '" & mm & "'" Set mrc1 = executeSQL (txtStr, msgTxt) 'clear the selected line myflexgrid in myflexgrid. removeItem (myflexgrid. rowSel) End Sub