I am trying to open a table and count the records. I keep getting record count is one. However when i past the code of my select statement into a query i get the number which i am looking for which is 13.
I eventually would like to filter the table to reduce the results.
- Dim db As DAO.Database
- Dim rs, rs2 As DAO.Recordset
- Dim strSQL, RIGACCT, ClientID, dispname, comp, acctno, bal, exp, expdel, EXPDELDATE, eq, eqdel, EQDELDATE, tu, tudel, tuddate As String
- Dim pudate, credotes, newpudate As String
- strSQL = "SELECT CREDITREPORT.RIGACCT_FK, CREDITREPORT.CLIENTID_FK, CREDITREPORT.DISPLAYNAME, CREDITREPORT.COMPANYNAME, CREDITREPORT.ACCOUNTNUMBER, CREDITREPORT.BALANCE, CREDITREPORT.EXPERIAN," _
- & " CREDITREPORT.EXPERIANDEL, CREDITREPORT.EXPDELDATE, CREDITREPORT.EQUIFAX, CREDITREPORT.EQUIFAXDEL, CREDITREPORT.EQDELDATE, CREDITREPORT.TRANSUNION, CREDITREPORT.TRANSUNIONDEL, " _
- & "CREDITREPORT.TUDELDATE, CREDITREPORT.PULLEDDATE, CREDITREPORT.CREDREPORTNOTES, CREDITREPORT.NEWPULLEDDATE " _
- & "FROM CREDITREPORT;"
- Set db = CurrentDb
- Set rs = db.OpenRecordset(strSQL)
- With rs
- Debug.Print .RecordCount
- Debug.Print strSQL
- Debug.Print db.OpenRecordset(strSQL).RecordCount
- End With
- Set rs = Nothing
- Set db = Nothing