Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/10/2007, 16:47
Lucky_man
 
Fecha de Ingreso: octubre-2006
Mensajes: 25
Antigüedad: 17 años, 6 meses
Puntos: 0
Re: Cómo agrego una fila en un datagrid

Cita:
Iniciado por felipedejess Ver Mensaje
hola podrias pasarme un ejemplo de este tema a mi mail, [email protected]
Adjunto lo solicitado:

Private Sub cmdAgregar_Click()
'Agrega al grid
Err.Clear
cnJoyeria.BeginTrans
sSQL = "INSERT INTO jo_param_prod(pp_empresa, pp_prod, pp_multiplo) " & _
"VALUES (1,'" & Trim(txtProducto.Text) & "'," & _
txtFactor.Text & ")"
cnJoyeria.Execute sSQL
If Err.Number <> 0 Then
mensaje = Err.Description
MsgBox mensaje, vbCritical, "System"
cnJoyeria.RollbackTrans
Exit Sub
Else
cnJoyeria.CommitTrans
deFactura.cmParamProd 1
grdProdMultiplo.DataMember = "cmParamProd"
deFactura.cnConecta.Close
deFactura.cnConecta.Open
ajustando_col
txtProducto.Text = ""
lblProducto.Caption = ""
txtFactor.Text = ""
End If
End Sub
Private Sub cmdAgregar_Click()
'Agrega al grid
Err.Clear
cnJoyeria.BeginTrans
sSQL = "INSERT INTO jo_param_prod(pp_empresa, pp_prod, pp_multiplo) " & _
"VALUES (1,'" & Trim(txtProducto.Text) & "'," & _
txtFactor.Text & ")"
cnJoyeria.Execute sSQL
If Err.Number <> 0 Then
mensaje = Err.Description
MsgBox mensaje, vbCritical, "System"
cnJoyeria.RollbackTrans
Exit Sub
Else
cnJoyeria.CommitTrans
deFactura.cmParamProd 1
grdProdMultiplo.DataMember = "cmParamProd"
deFactura.cnConecta.Close
deFactura.cnConecta.Open
ajustando_col
txtProducto.Text = ""
lblProducto.Caption = ""
txtFactor.Text = ""
End If
End Sub