Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/01/2005, 11:26
Avatar de GeoAvila
GeoAvila
Colaborador
 
Fecha de Ingreso: diciembre-2003
Ubicación: Antigua Guatemala
Mensajes: 4.032
Antigüedad: 20 años, 5 meses
Puntos: 53
aqui hay un ejemplo

Código:
Private Sub CmdGuardar_Click()
On Local Error Resume Next
Set Cxn = New Connection
Dim Lectura As String
Dim FechaR As String
Dim FechaIn As String
Dim FechaEg As String
Me.FrGuardar.Visible = True
Me.LblInformacion.Caption = "Conectando.."
FechaR = Format$(DTFechaRecibo.Value, "yyyy/MM/dd")
FechaIn = Format$(DTIngreso.Value, "yyyy/MM/dd")
FechaEg = Format$(DTEgreso.Value, "yyyy/MM/dd")
Cxn.Open CxnFac
    If Err <> 0 Then
    MsgBox "Ha ocurrido un error en la conexión el programa intentara de nuevo ", vbExclamation, "Error"
    Cxn.Close
    Call CmdGuardar_Click
    End If
Me.LblInformacion.Caption = "Guardando.."
Lectura = "INSERT INTO anticipos values(" & Val(TxtNoRecibo.Text) & ", '" & FechaR & "','" & TxtNombreCliente.Text & "'," & Val(OptTotal.Value) & "," & Val(TxtHabitaciones.Text) & ",'" & FechaIn & "','" & FechaEg & "'," & Val(ChkCheque.Value) & "," & Val(ChkTC.Value) & "," & Val(ChkEfectivo.Value) & "," & Val(TxtQuetzalez.Text) & ",'" & TxtReceptor.Text & "','" & TxtObservaciones.Text & "','0','');"
Cxn.Execute Lectura
    If Err <> 0 Then
    MsgBox "Ha habido un error al guardar los datos, el programa seguira intentando guardarlos ", vbInformation, "Error"
    Cxn.Close
    Call CmdGuardar_Click
    End If
Me.FrGuardar.Visible = False
MsgBox "Los datos se han guardado satisfactoriamente", vbInformation, "Guardado"
End Sub
espero te sirva el ejemplo..

nos vemos..
__________________
* Antes de preguntar lee las FAQ, y por favor no hagas preguntas en las FAQ
Sitio http://www.geoavila.com twitter: @GeoAvila