MovePrevious is returning an errror

The related question explains the issue that I am having. I wasn't able to reproduce the error for some reason, but have now been able to reproduce it 100% again.

I'm getting a "Either BoF or EoF is true..." error when I'm neither at the beginning or end of my file.

My problem is isolating where exactly the issue is starting. I know that the issue is happening when I try and MovePrevious at a specific point in my code. For some reason why I try at this point, it doesn't like it and thinks I'm at the EoF or BoF.

I've used the MovePrevious command in other portions of my code without issue.

I placed this bit of code prior to the MovePrevious which is giving me an error and oddly enough it says that "Neither BOF or EOF is True". The next line is my MovePrevious which crashes and returns the error "Either BoF or EoF is true..."

Any thoughts on how I can possibly debug this more and figure out what the heck is going on?

If adoInputRS.BOF = True Then
                    MsgBox "BOF is True"
                ElseIf adoInputRS.EOF = True Then
                    MsgBox "EOF is True"
                Else
                    MsgBox "Neither EOF or BOF is True"
                End If

Open in new window

thach1ef2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thach1ef2Author Commented:
I got it! But now I want to know why it's happening haha.

The excel sheet has 5 columns. 4 are filled in with data and the 5th one is blank and I use it as a status column. When I process a record/line, I fill in the status column.

It looks like if I try to MovePrevious to a line where I've filled in the status column, it's giving me this error and crashing. I removed the line that made the status column updates and tried a MovePrevious in the same place where I was crashing and it worked.

Why is this happening? How can I update the status column and use MovePrevious afterward without there being an issue?
0
thach1ef2Author Commented:
I figured this one out. It was due to the way I was filtering.

If I filled out the status column, then MovePrevious was going to BOF since that status column was now filled in and my filter wanted it to be = NULL.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thach1ef2Author Commented:
The filter that I was applying was only looking for entries where the status column = NULL. Once I filled out that status column in my script, it was no longer meeting the criteria. Which when doing a MovePrevious would mean it skipped over it and would go to BOF, causing the error
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.