Private Function validateRow() As Boolean
Dim i As Integer
Dim iRow As Integer
Dim Facturar As Boolean
Dim Importe As Single
Dim RespImporte As Integer
Dim ConceptoPago As String
Dim Formapago As String
Dim TarifaBrazalete As Integer
Dim RespBrazalete As Integer
Dim TipoCambioCupon As Single
Dim SiguienteConsecutivo As Integer
Dim strUpdate As String
Dim strInsert As String
Dim tFields() As String
Dim sTmp As String
    
    validateRow = True
    If Not blnFieldChanged Then Exit Function
    
    iRow = SCGrid1.CurrentRow
    ReDim tFields(SCGrid1.Cols - 1)
    
    For i = 0 To SCGrid1.Cols  1
        sTmp = SCGrid1.Text(iRow, i)
    Select Case i
        Case 0
            tFields(i) = sTmp
        Case 2, 4
            tFields(i) = "'" & sTmp & "'"
          Case 11
                    tFields(i) = IIf(sTmp = "", "False", "True")
        End Select
    Next i
        
    On Error GoTo ErrorHandle
    Actualiza la fila que cambio
        strUpdate = "update [Facturacion Temporal] set "  'CFFacturado = " & Facturar
        strUpdate = strUpdate & SCGrid1.Key(-1, 11) & "=" & tFields(11)
        strUpdate = strUpdate & " where " & SCGrid1.Key(-1, 1) & "=" & tFields(0) & " And " & SCGrid1.Key(-1, 2) & "=" & tFields(2) & " And " & SCGrid1.Key(-1, 4) & "=" & tFields(4)

        db.Execute strUpdate
        
        StatusBar1.Panels(2).Text = "Cupon actualizado"
    
       initVariables
    On Error GoTo 0
    
Exit Function
ErrorHandle:
    MsgBox err.Description
    validateRow = False
    
End Function
