Empty ListBox has ListCount = 1 --- Follow-Up

B

Bob Howard

Hi everyone (especially Allen Browne);

I don't know how the problem became a problem, but I noticed another "issue"
in the database and worked to correct it. By correcting it, I also somehow
corrected the original problem where an empty ListBox returned a ListCount =
1 (with ColumnHeads = No). [By the way, this also turned out to be
happening with Combo Boxes.]

The other problem was that I noticed that the source statements for every
one of the requery methods (all 98 of them) were like
something_or_other.requery and not something_or_other.Requery (note that the
"r" was not capitalized).

Whenever I would change an "r" to an "R" (which Access should have done by
itself), it changed back to an "r". Even a global replace didn't help!

As a test, I looked into each of the 5 prior versions of this database that
were still on my hard drive, and the requery methods all had an "R". In
fact, when I tried to change any to an "r", Access changed it back to an "R"
(which is what should have happened).

So I re-constructed the MDB by starting with a blank database, importing
everything, redefining the startup parameters, etc. (this also resulted in a
600k reduction in the MDB).

After re-establishing the DAO 3.6 reference and recompiling the VBA, I
changed one of the requery methods from "r" to "R" and all 97 others changed
to an "R"!

And when I tested the result, the ListCount problem has now gone away!

Good ole A2K!

Bob (@Martureo_Org)
 
A

Allen Browne

Thanks for posting the solution, Bob.

The lower case "requery" indicates that VBA was identifying the command with
some other name that was around at some time, and your rebuild got it
identifying with the correct thing. Whether the other problem was caused by
the same issue, or fixed by the same process, the rebuild was a good idea.
Well done.
 
Top