Consulta de código para conectar a base de datos y realizar consultas a tablas
Cual es el problema al declarar el recordset Direccion1, pues me da un error 3061, en el siguiente código
Dim Personas1 As Recordset
Dim Direccion1 As Recordset
Dim cadena As String
cadena = "SELECT * FROM Personas1;"
Set Personas1 = CurrentDb.OpenRecordset(cadena, dbOpenForwardOnly)
If Personas1.RecordCount Then
Do Until Personas1.EOF
Dim ssss As String
ssss = "SELECT * FROM Direccion1 WHERE Cod_pe = Personas1![Codigo];"
Set Direccion1 = CurrentDb.OpenRecordset(ssss, dbOpenForwardOnly)
.
. Etc
Dim Personas1 As Recordset
Dim Direccion1 As Recordset
Dim cadena As String
cadena = "SELECT * FROM Personas1;"
Set Personas1 = CurrentDb.OpenRecordset(cadena, dbOpenForwardOnly)
If Personas1.RecordCount Then
Do Until Personas1.EOF
Dim ssss As String
ssss = "SELECT * FROM Direccion1 WHERE Cod_pe = Personas1![Codigo];"
Set Direccion1 = CurrentDb.OpenRecordset(ssss, dbOpenForwardOnly)
.
. Etc
Respuesta de giorgiog
1