Jreyes10 de Junio del 2004
PreguntaESTE ES EL CODIGO QUE ME DIO EL ERROR
cuando ejecuto guardar me da el error que puse en el mensaje enterior
Private Sub cmdGuardar_Click()
'si la funcion verificar_datos retorna un valor TRUE entonces almacena datos
If Verificar_Datos Then
'insertar en la tabla miembros
'formato: "INSERT INTO table(campo, campo, campo...) VALUE(valor, valor, valor...)
sSQL = "INSERT INTO miembros "
sSQL = sSQL & "(mnombres, mapellidos, mdirecc1, mdirecc2, "
sSQL = sSQL & "mfnacim, mlugarnac, mnaciona, mcelular, mcedula, mestcivil, "
sSQL = sSQL & "mbeeper, memail, mtelefon, mprofesion, msexo, mtiposangre, "
sSQL = sSQL & "mcontacto, mtelefonocontacto, mrazon, mestado, mfechaconversion, "
sSQL = sSQL & "mfechabautismo, miglesiabautismo, mministerio, mministro, "
sSQL = sSQL & "mmiembroadherente, mcargo, mobservaciones) "
sSQL = sSQL & "VALUES ('" & Trim(txtNombre.Text) & "', '" & Trim(txtApellidos.Text) & "', '"
sSQL = sSQL & Trim(txtDireccion1.Text) & "', '" & Trim(txtDireccion2.Text) & "', '"
sSQL = sSQL & mskFechaNacimiento.Text & "', '" & Trim(txtLugarNacimiento.Text) & "', '"
sSQL = sSQL & Trim(txtNacionalidad.Text) & "', '" & mskCelular.Text & "', '"
sSQL = sSQL & mskCedula.Text & "', " & Buscar_ID_EstadoCivil(cboEstadoCivil.Text) & ", '"
sSQL = sSQL & mskBeeper.Text & "', '" & Trim(txtEmail.Text) & "', '"
sSQL = sSQL & mskTelefonoCasa.Text & "', '" & Trim(txtProfesion.Text) & "', "
sSQL = sSQL & IIf(optSexo(0).Value = True, 0, 1) & ", "
sSQL = sSQL & Buscar_ID_TipoSangre(cboTipoSangre.Text) & ", '"
sSQL = sSQL & Trim(txtContacto.Text) & "', '" & mskTelefonoContacto.Text & "', "
sSQL = sSQL & Razon & ", " & Estado & ", '" & mskFechaConversion.Text & "', '"
sSQL = sSQL & mskFechaBautismo.Text & "', '" & Trim(txtIglesiaBautismo.Text) & "', '"
sSQL = sSQL & Trim(txtMinisterio.Text) & "', '" & Trim(txtMinistro.Text) & "', "
sSQL = sSQL & IIf(chkMiembroAdherente.Value = False, 0, 1) & ", '" & Trim(txtCargo.Text) & "', '"
sSQL = sSQL & Trim(txtObservaciones.Text) & "')"
dbIglesia.Execute sSQL, , adCmdText
MsgBox "Miembro registrado correctamente...", vbInformation, App.ProductName
Call Limpiar_Campos(frmMiembros)
tabPrincipal.Tab = 0
End If
End Sub
cuando ejecuto guardar me da el error que puse en el mensaje enterior
Private Sub cmdGuardar_Click()
'si la funcion verificar_datos retorna un valor TRUE entonces almacena datos
If Verificar_Datos Then
'insertar en la tabla miembros
'formato: "INSERT INTO table(campo, campo, campo...) VALUE(valor, valor, valor...)
sSQL = "INSERT INTO miembros "
sSQL = sSQL & "(mnombres, mapellidos, mdirecc1, mdirecc2, "
sSQL = sSQL & "mfnacim, mlugarnac, mnaciona, mcelular, mcedula, mestcivil, "
sSQL = sSQL & "mbeeper, memail, mtelefon, mprofesion, msexo, mtiposangre, "
sSQL = sSQL & "mcontacto, mtelefonocontacto, mrazon, mestado, mfechaconversion, "
sSQL = sSQL & "mfechabautismo, miglesiabautismo, mministerio, mministro, "
sSQL = sSQL & "mmiembroadherente, mcargo, mobservaciones) "
sSQL = sSQL & "VALUES ('" & Trim(txtNombre.Text) & "', '" & Trim(txtApellidos.Text) & "', '"
sSQL = sSQL & Trim(txtDireccion1.Text) & "', '" & Trim(txtDireccion2.Text) & "', '"
sSQL = sSQL & mskFechaNacimiento.Text & "', '" & Trim(txtLugarNacimiento.Text) & "', '"
sSQL = sSQL & Trim(txtNacionalidad.Text) & "', '" & mskCelular.Text & "', '"
sSQL = sSQL & mskCedula.Text & "', " & Buscar_ID_EstadoCivil(cboEstadoCivil.Text) & ", '"
sSQL = sSQL & mskBeeper.Text & "', '" & Trim(txtEmail.Text) & "', '"
sSQL = sSQL & mskTelefonoCasa.Text & "', '" & Trim(txtProfesion.Text) & "', "
sSQL = sSQL & IIf(optSexo(0).Value = True, 0, 1) & ", "
sSQL = sSQL & Buscar_ID_TipoSangre(cboTipoSangre.Text) & ", '"
sSQL = sSQL & Trim(txtContacto.Text) & "', '" & mskTelefonoContacto.Text & "', "
sSQL = sSQL & Razon & ", " & Estado & ", '" & mskFechaConversion.Text & "', '"
sSQL = sSQL & mskFechaBautismo.Text & "', '" & Trim(txtIglesiaBautismo.Text) & "', '"
sSQL = sSQL & Trim(txtMinisterio.Text) & "', '" & Trim(txtMinistro.Text) & "', "
sSQL = sSQL & IIf(chkMiembroAdherente.Value = False, 0, 1) & ", '" & Trim(txtCargo.Text) & "', '"
sSQL = sSQL & Trim(txtObservaciones.Text) & "')"
dbIglesia.Execute sSQL, , adCmdText
MsgBox "Miembro registrado correctamente...", vbInformation, App.ProductName
Call Limpiar_Campos(frmMiembros)
tabPrincipal.Tab = 0
End If
End Sub
