Dim conn As Connection
Dim strSQL As String ' Select statement for data for TaxBill table
Dim strTemp As String 'string for building carat delimited line of text
Dim rec As Record
Dim rsTaxBillData As Recordset
Set conn = New Connection
Set rsTaxBillData = New Recordset
conn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=WarrickTax;Data Source=(local)"
strSQL = "SELECT mpropertyNumber, mmapNumber, mbillNumber, mtaxYear, mtaxRate, mhomesteadCreditRate," & _
"mreplacementCreditRate, munit1AmountTotal, mgrossResAmount1, mresReplacementCreditAmount1," & _
"mresHomesteadCreditAmount1, mresNetTaxAmount1, mgrossNonResAmount1, mnonResReplacementCreditAmount1," & _
"mnonResNetTaxAmount1, mnetTaxAmount1, mlateAssessmentPenalty1, mlateAssessmentInterest1," & _
"mdelinquentTaxAmount, mdelinquentPenaltyAmount, mtotalDelqTaxPenaltyAmount, mtotalPrepaymentAmount1," & _
"mtotalAmountDue1, mspringInstallmentDueDate, mfallInstallmentDueDate, munit2AmountTotal, mgrossResAmount2," & _
"mresReplacementCreditAmount2, mresHomesteadCreditAmount2, mresNetTaxAmount2, mgrossNonResAmount2," & _
"mnonResReplacementCreditAmount2, mnonResNetTaxAmount2, mnetTaxAmount2, mlateAssessmentPenalty2," & _
"mlateAssessmentInterest2 , mtotalPrepaymentAmount2, mtotalAmountDue2, mpaymentAmount1, mpaymentAmount2 From T_MVPTSTTaxBill"
rsTaxBillData.Open strSQL, conn
Open "C:\tblRETaxBills.txt" For Output As #1
rsTaxBillData.MoveFirst
For Each rec In rsTaxBillData <=-- Error here. Run-time error 438: Object doesn't support the property or method
'Do stuff
Next
Close #1
rsTaxBillData.Close
conn.Close