'Define the module-level variable dim nowrow as integer Step 1: Add the following code to the mshflexgrid mousedown event: private sub mfgadddeleteuser_mousedown (button as integer, shift as integer, X as single, Y as single) with mfgadddeleteuser. row =. mouserow nowrow =. row. col = 0. colsel =. cols-1 end withend sub Step 2: Add the following code to the mshflexgrid mouseup event: private sub mfgadddeleteuser_mouseup (button as integer, shift as integer, X as single, y as Single) with mfgadddeleteuser. rowsel = nowrow. colsel =. cols-1 end withend sub Step 3: Add the following code private sub into delete_click () dim rstmrc as ADODB under the "delete" button. recordset dim strsql as string dim strmsg as string 'delete selected records in the database strsql = "delete from user_info where userid = '" & trim (mfgadddeleteuser. textmatrix (mfgadddeleteuser. row, 0) & "'" set rstmrc = executesql (strsql, strmsg)' Delete the selected mfgadddeleteuser from mfgadddeleteuser. removeitem mfgadddeleteuser. row end sub