Problema con Formulario error 2467
Tengo un pequeño problema estoy generando un procedimiento en un formulario, que cierro, adjunto datos nuevos en la tabla, y yabro nuevamente, y así las veces necesarias, pero cuando ejecuta la acción por segunda vez me genera el error 2467, envío la instrucción para ver donde esta el error
Gracias
Public Function OfSolicit()
Dim CON As Double
Dim CdIn As Double
Dim CdIn1 As String
Dim CdRef As Double
Dim IdCont As String
Dim IdCar As Double
Dim Lon As Double
Dim Mov As String
Dim Ofi As String
Dim ips As String
Dim Refe As Double
Dim SolRef As String
Dim SolRef_rs As DAO.Recordset
Dim OfNul As String
Dim OfNul_rs As DAO.Recordset
Dim Direc As String
Dim Direc_rs As DAO.Recordset
Dim Conta As String
Dim Conta_rs As DAO.Recordset
Dim SolDoc As String
Dim SolDoc_rs As DAO.Recordset
Dim SolFir As String
Dim SolFir_rs As DAO.Recordset
With Form_Dialogo_Solicitudes
Select Case .SolicitudDocFirm
Case 1
CdIn = .Id_Org
SolRef = "SELECT dbo_V_DIRECTORIO1.Id_EAPB, dbo_V_DIRECTORIO1.ID_CONTACTO, Contacto_Ref.Id_Referencia AS Ref, CONTACTOS_ORG.Cargo, dbo_V_DIRECTORIO1.Nombre FROM ((dbo_V_DIRECTORIO1 INNER JOIN Contacto_Ref ON dbo_V_DIRECTORIO1.ID_CONTACTO = Contacto_Ref.Id_Contacto) INNER JOIN CONTACTOS_ORG ON (Contacto_Ref.Id_Contacto = CONTACTOS_ORG.Id_Contacto) AND (Contacto_Ref.Id_Contacto_ORG = CONTACTOS_ORG.Id_Contacto_ORG)) INNER JOIN LISTAS ON Contacto_Ref.Id_Referencia = LISTAS.Indice WHERE (((dbo_V_DIRECTORIO1.Id_EAPB)='" & CdIn & "') AND ((LISTAS.Valor) Like 'solicitudes*') AND ((LISTAS.Nom_Tabla)='Contactos_Ref'));"
Set SolRef_rs = CurrentDb.OpenRecordset(SolRef)
If SolRef_rs.RecordCount > 0 Then
Do While Not SolRef_rs.EOF
Refe = SolRef_rs!Ref
OfNul = "SELECT [SOLICITUD DOCUMENTOS].Consecutivo_oficio, ENCABEZADO.Cod_Interno, [SOLICITUD DOCUMENTOS].Estado, [TIPO SOLICITUD].Id_ref_Contacto FROM ENCABEZADO INNER JOIN ([SOLICITUD DOCUMENTOS] INNER JOIN [TIPO SOLICITUD] ON [SOLICITUD DOCUMENTOS].Id_tipo_sol = [TIPO SOLICITUD].id) ON ENCABEZADO.No_Factura_Enc = [SOLICITUD DOCUMENTOS].No_FACT_SOLICITUD WHERE ((([SOLICITUD DOCUMENTOS].Consecutivo_oficio) Is Null) AND ((ENCABEZADO.Cod_Interno)=" & CdIn & ") AND (([SOLICITUD DOCUMENTOS].Estado)=1) AND (([TIPO SOLICITUD].Id_ref_Contacto)=" & Refe & "));"
Set OfNul_rs = CurrentDb.OpenRecordset(OfNul)
If OfNul_rs.RecordCount > 0 Then
.Ref = Refe
CdRef = .Ref
.Id_Org = CdIn
CdIn1 = .Id_Org
Direc = "SELECT dbo_V_DIRECTORIO1.Id_EAPB, dbo_V_DIRECTORIO1.ID_CONTACTO, Contacto_Ref.Id_Referencia, CONTACTOS_ORG.Cargo, dbo_V_DIRECTORIO1.Nombre FROM (dbo_V_DIRECTORIO1 INNER JOIN Contacto_Ref ON dbo_V_DIRECTORIO1.ID_CONTACTO = Contacto_Ref.Id_Contacto) INNER JOIN CONTACTOS_ORG ON (Contacto_Ref.Id_Contacto_ORG = CONTACTOS_ORG.Id_Contacto_ORG) AND (Contacto_Ref.Id_Contacto = CONTACTOS_ORG.Id_Contacto) WHERE (((dbo_V_DIRECTORIO1.Id_EAPB)='" & CdIn1 & "') AND ((Contacto_Ref.Id_Referencia)=" & CdRef & "));"
Set Direc_rs = CurrentDb.OpenRecordset(Direc)
If Direc_rs.RecordCount > 0 Then
IdCont = Direc_rs!Id_Contacto
IdCar = Direc_rs!Cargo
ips = Direc_rs!NOMBRE
.Id_Contacto = IdCont
.Id_Cargo = IdCar
.Respecto_IPS = ips
.Requiere_Rta = -1
.Id_Org = CdIn
.AñoActual =...
Gracias
Public Function OfSolicit()
Dim CON As Double
Dim CdIn As Double
Dim CdIn1 As String
Dim CdRef As Double
Dim IdCont As String
Dim IdCar As Double
Dim Lon As Double
Dim Mov As String
Dim Ofi As String
Dim ips As String
Dim Refe As Double
Dim SolRef As String
Dim SolRef_rs As DAO.Recordset
Dim OfNul As String
Dim OfNul_rs As DAO.Recordset
Dim Direc As String
Dim Direc_rs As DAO.Recordset
Dim Conta As String
Dim Conta_rs As DAO.Recordset
Dim SolDoc As String
Dim SolDoc_rs As DAO.Recordset
Dim SolFir As String
Dim SolFir_rs As DAO.Recordset
With Form_Dialogo_Solicitudes
Select Case .SolicitudDocFirm
Case 1
CdIn = .Id_Org
SolRef = "SELECT dbo_V_DIRECTORIO1.Id_EAPB, dbo_V_DIRECTORIO1.ID_CONTACTO, Contacto_Ref.Id_Referencia AS Ref, CONTACTOS_ORG.Cargo, dbo_V_DIRECTORIO1.Nombre FROM ((dbo_V_DIRECTORIO1 INNER JOIN Contacto_Ref ON dbo_V_DIRECTORIO1.ID_CONTACTO = Contacto_Ref.Id_Contacto) INNER JOIN CONTACTOS_ORG ON (Contacto_Ref.Id_Contacto = CONTACTOS_ORG.Id_Contacto) AND (Contacto_Ref.Id_Contacto_ORG = CONTACTOS_ORG.Id_Contacto_ORG)) INNER JOIN LISTAS ON Contacto_Ref.Id_Referencia = LISTAS.Indice WHERE (((dbo_V_DIRECTORIO1.Id_EAPB)='" & CdIn & "') AND ((LISTAS.Valor) Like 'solicitudes*') AND ((LISTAS.Nom_Tabla)='Contactos_Ref'));"
Set SolRef_rs = CurrentDb.OpenRecordset(SolRef)
If SolRef_rs.RecordCount > 0 Then
Do While Not SolRef_rs.EOF
Refe = SolRef_rs!Ref
OfNul = "SELECT [SOLICITUD DOCUMENTOS].Consecutivo_oficio, ENCABEZADO.Cod_Interno, [SOLICITUD DOCUMENTOS].Estado, [TIPO SOLICITUD].Id_ref_Contacto FROM ENCABEZADO INNER JOIN ([SOLICITUD DOCUMENTOS] INNER JOIN [TIPO SOLICITUD] ON [SOLICITUD DOCUMENTOS].Id_tipo_sol = [TIPO SOLICITUD].id) ON ENCABEZADO.No_Factura_Enc = [SOLICITUD DOCUMENTOS].No_FACT_SOLICITUD WHERE ((([SOLICITUD DOCUMENTOS].Consecutivo_oficio) Is Null) AND ((ENCABEZADO.Cod_Interno)=" & CdIn & ") AND (([SOLICITUD DOCUMENTOS].Estado)=1) AND (([TIPO SOLICITUD].Id_ref_Contacto)=" & Refe & "));"
Set OfNul_rs = CurrentDb.OpenRecordset(OfNul)
If OfNul_rs.RecordCount > 0 Then
.Ref = Refe
CdRef = .Ref
.Id_Org = CdIn
CdIn1 = .Id_Org
Direc = "SELECT dbo_V_DIRECTORIO1.Id_EAPB, dbo_V_DIRECTORIO1.ID_CONTACTO, Contacto_Ref.Id_Referencia, CONTACTOS_ORG.Cargo, dbo_V_DIRECTORIO1.Nombre FROM (dbo_V_DIRECTORIO1 INNER JOIN Contacto_Ref ON dbo_V_DIRECTORIO1.ID_CONTACTO = Contacto_Ref.Id_Contacto) INNER JOIN CONTACTOS_ORG ON (Contacto_Ref.Id_Contacto_ORG = CONTACTOS_ORG.Id_Contacto_ORG) AND (Contacto_Ref.Id_Contacto = CONTACTOS_ORG.Id_Contacto) WHERE (((dbo_V_DIRECTORIO1.Id_EAPB)='" & CdIn1 & "') AND ((Contacto_Ref.Id_Referencia)=" & CdRef & "));"
Set Direc_rs = CurrentDb.OpenRecordset(Direc)
If Direc_rs.RecordCount > 0 Then
IdCont = Direc_rs!Id_Contacto
IdCar = Direc_rs!Cargo
ips = Direc_rs!NOMBRE
.Id_Contacto = IdCont
.Id_Cargo = IdCar
.Respecto_IPS = ips
.Requiere_Rta = -1
.Id_Org = CdIn
.AñoActual =...
1 respuesta
Respuesta de manuelpacha
1