Sir ,
when i press a Save button one extra row is inserting how
should i remove that cell :
Private Sub Command1_Click()
On Error Resume Next
If (CheckInput) Then
Dim row As Integer
Set rs = New Recordset
For row = 1 To Grd.Rows
rs.Open " SELECT * FROM MR ", con, adOpenDynamic, adLockOptimistic
rs.AddNew
rs.Fields("Dept_name") = Combo1.Text
rs.Fields("job_no") = Text1.Text
rs.Fields("cost_centre") = CLng(Text2.Text)
rs.Fields("emp_name") = Text3.Text
rs.Fields("del_point") = Text4.Text
rs.Fields("del_time") = CStr(MaskEdBox1)
rs.Fields("del_date") = DTPicker2.Value
rs.Fields("sug_vendor") = Text7.Text
rs.Fields("mr_date") = DTPicker1.Value
rs.Fields("manager") = Text13.Text
' rs1.Fields("qty") = FlexGridEditor.Value
rs.Fields("item_code") = Grd.TextMatrix(CLng(row), 1)
rs.Fields("productname") = Grd.TextMatrix(CLng(row), 2)
rs.Fields("unit") = Grd.TextMatrix(CLng(row), 3)
rs.Fields("qty") = Grd.TextMatrix(CLng(row), 4)
If rs.Fields("Item_code") = "" Then
Exit For
Exit Sub
End If
Next
MsgBox Trim(Grd.TextMatrix(1, 1))
MsgBox "Commit", vbInformation, Me.Name
rs.Update
rs.Close
End If
'err: MsgBox "Error in Command1_Click()" & vbCrLf & err.Number & vbCrLf & err.Description
End Sub