A
aceavl via AccessMonster.com
hi!
i'm having some probles with this, hope someone can help me.
i have 2 tables: tblPrestamos and tblPagosPrestamos y created the querys and
opened 2 recorsets
Dim db As Database
Dim rsPagos As DAO.Recordset
Dim rsPrestamos As DAO.Recordset
Dim qryPagos As String
Dim qryPrestamos As String
qryPagos = "SELECT [tblPagosPrestamos].[PagosPrestamosIDPK],
[tblPagosPrestamos].[PagosPrestamosMonto], [tblPagosPrestamos].
[PagosPrestamosFecha], [tblPagosPrestamos].[ClientesIDFK], [tblPagosPrestamos]
..[PrestamosIDFK] FROM [tblPagosPrestamos] WHERE ([tblPagosPrestamos].
[ClientesIDFK]= " & lngCliente & ")"
qryPrestamos = "SELECT [tblPrestamos].[PrestamosIDPK], [tblPrestamos].
[PrestamosMonto], [tblPrestamos].[PrestamosFecha], [tblPrestamos].
[ClientesIDFK], [tblPrestamos].[PrestamosMeses] FROM [tblPrestamos] WHERE (
[tblPrestamos].[ClientesIDFK]= " & lngCliente & ")"
Set db = CurrentDb
Set rsPagos = db.OpenRecordset(qryPagos)
Set rsPrestamos = db.OpenRecordset(qryPrestamos)
i'm going in a loop in rsPrestamos and need to filter rsPagos with
rsPrestamos!PrestamosIDPK=rsPagos!PrestamosIDFK
how do i put a WHERE clause inside the SELECT statement to reference another
recordset?
thanks
i'm having some probles with this, hope someone can help me.
i have 2 tables: tblPrestamos and tblPagosPrestamos y created the querys and
opened 2 recorsets
Dim db As Database
Dim rsPagos As DAO.Recordset
Dim rsPrestamos As DAO.Recordset
Dim qryPagos As String
Dim qryPrestamos As String
qryPagos = "SELECT [tblPagosPrestamos].[PagosPrestamosIDPK],
[tblPagosPrestamos].[PagosPrestamosMonto], [tblPagosPrestamos].
[PagosPrestamosFecha], [tblPagosPrestamos].[ClientesIDFK], [tblPagosPrestamos]
..[PrestamosIDFK] FROM [tblPagosPrestamos] WHERE ([tblPagosPrestamos].
[ClientesIDFK]= " & lngCliente & ")"
qryPrestamos = "SELECT [tblPrestamos].[PrestamosIDPK], [tblPrestamos].
[PrestamosMonto], [tblPrestamos].[PrestamosFecha], [tblPrestamos].
[ClientesIDFK], [tblPrestamos].[PrestamosMeses] FROM [tblPrestamos] WHERE (
[tblPrestamos].[ClientesIDFK]= " & lngCliente & ")"
Set db = CurrentDb
Set rsPagos = db.OpenRecordset(qryPagos)
Set rsPrestamos = db.OpenRecordset(qryPrestamos)
i'm going in a loop in rsPrestamos and need to filter rsPagos with
rsPrestamos!PrestamosIDPK=rsPagos!PrestamosIDFK
how do i put a WHERE clause inside the SELECT statement to reference another
recordset?
thanks