Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recordset.edit in a Loop (VB6 DAO)
#1
Code:
Dim R As Integer
        Dim C As Integer
        C = 0
        R = 1
Do Until C = FGfac.Rows - 1
If cmdagregar.Enabled = True Then
        RST.AddNew
Else
        RST.Edit
If Not C = 0 Then
        RST.MoveNext
End If
End If
        RST![N° Factura] = txtnumfactura
        RST![Codigo Producto] = FGfac.TextMatrix(R, 0)
        RST![Cantidad Producto] = FGfac.TextMatrix(R, 2)
        C = C + 1
        R = R + 1
If C = FGfac.Rows - 1 Or cmdagregar.Enabled = True Then
        RST.Update
End If
        Loop

Sadly doing it like this only loops once before going error code "Update or CancelUpdate without addnew or edit" on me Rolleyes

Someone knows of a way to make it Edit all the records and not just only the first one? (Btw .AddNew Works like a charm, its .Edit that im having a problem with)


Messages In This Thread
Recordset.edit in a Loop (VB6 DAO) - by FenixR - 2011-10-12, 01:10 PM
Recordset.edit in a Loop (VB6 DAO) - by FenixR - 2011-10-12, 01:40 PM
Recordset.edit in a Loop (VB6 DAO) - by Spaz - 2011-10-12, 07:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)