I can't figure out why I'm getting EOF or BOF error when looping through only a couple of times...
Do While rst.EOF = False
testNo_Rows = rst.RecordCount
iPhoneNumber = CStr(Replace(rst("SUBSCRIBER #"), "-", ""))
iAmountLoaded = rst("SUBSCRIBER TOTAL")
iAmountBilled = iAmountLoaded + acct_Amt_allocate
iStampDateTime = Now()
rstMobileDevices.Open ("select Phone_Number, User_Id, first(Mobile_Type) as Mobile_Type, max(STAMP_DATETIME) FROM tbl_Mobile_Devices WHERE Phone_Number = '" & iPhoneNumber & "' GROUP BY Phone_Number, User_Id")
If rstMobileDevices("Mobile_Type") = "Blackberry" Then iChgTypeId = 7 Else iChgTypeId = 6
rstUsers.Open ("select * from tbl_Users where User_Id = " & rstMobileDevices("User_Id"))
iUserId = rstUsers("User_Id")
iCostCtr = rstUsers("CostCtr_Id")
rstMobileDevices.Close
rstUsers.Close
testCount = testCount + 1
If rst.EOF = True Then Exit Do
If rst.BOF = True Then Exit Do
rst.MoveNext
If rst.EOF = True Then Exit Do
If rst.BOF = True Then Exit Do
Loop
Do While rst.EOF = False
testNo_Rows = rst.RecordCount
iPhoneNumber = CStr(Replace(rst("SUBSCRIBER #"), "-", ""))
iAmountLoaded = rst("SUBSCRIBER TOTAL")
iAmountBilled = iAmountLoaded + acct_Amt_allocate
iStampDateTime = Now()
rstMobileDevices.Open ("select Phone_Number, User_Id, first(Mobile_Type) as Mobile_Type, max(STAMP_DATETIME) FROM tbl_Mobile_Devices WHERE Phone_Number = '" & iPhoneNumber & "' GROUP BY Phone_Number, User_Id")
If rstMobileDevices("Mobile_Type") = "Blackberry" Then iChgTypeId = 7 Else iChgTypeId = 6
rstUsers.Open ("select * from tbl_Users where User_Id = " & rstMobileDevices("User_Id"))
iUserId = rstUsers("User_Id")
iCostCtr = rstUsers("CostCtr_Id")
rstMobileDevices.Close
rstUsers.Close
testCount = testCount + 1
If rst.EOF = True Then Exit Do
If rst.BOF = True Then Exit Do
rst.MoveNext
If rst.EOF = True Then Exit Do
If rst.BOF = True Then Exit Do
Loop