Okay, you realize you have buttons labeled find next record and find previous record as well as find previous apt# and find next apt# I think that's where the confusion lies.
No problem I'm looking at your code, give me a while to study it.
One think I noticed right away is you have a variable at the top of the module.
Then in one of your procedures you have:
If you intend these to be the same variable, they are not.
By having Dim lastrow in your cmdPrevious procedure it's a separate variable that can only be used within the procedure that it's declared in. Changing its value does not change the variable at the top. As soon as you hit the end of the procedure the variable is destroyed. The variable at the top is not changed from it's previous value.
If you knew this and it's what you intended, I would advise again it as it's confusing. Make those in your sub procedures a different name so as to avoid confusion.
Bookmarks