November 12, 2010 Leave a comment
I have an unbound form with a listbox. On opening the form the listbox is hidden. If certain criteria are met, it is made visible and populated via
Me!lstWebImport.RowSourceType = “Table/View/StoredProc”
Me!lstWebImport.RowSource = mySQL
mySQL is a simple select on a customer table
The listbox is 1 row tall (0.1563″) with vertical scroll bars if there are multiple records returned by the select. This has been working fine on our XP systems for years. We recently started our win7 upgrade cycle and have run into the following problem on the win7 boxes (remaining XP systems still work fine).
The value in the listbox became unselectable and even un-Clickable. Since clicking the value in the listbox fired an onClick event, this was a bit of a problem 😉
I checked the properties of the listbox and they were set to enabled, I also explicitly set enabled = true in the form events just to make sure.
I also installed 945280 (http://support.microsoft.com/kb/945280/ ) Combo box controls and list box controls display no value or incorrect values in Access 2003 after you install Office 2003 Service Pack 3 even though that wasn’t exactly my issue.
Nothing worked. My google-foo didn’t turn up anything either.
I got a clue to what was happening when I made the listbox twice as tall (.3″) This showed me a horizontal scroll bar and the very bottom of the record i want to click. By making the list box 1″ tall I was able to see the record, and click it as normal. Strangely, the horizontal scroll bar showed the last column to be something like 6 inches wide (guessing) Knowing that the last column was for phone #’s, there should have been no reason for that column to be so wide.
I had a look at the other properties for the listbox and saw this
Column Count: 7
Column Widths: 0″;1″;1″;1″;0.25″;1.5″;
Note that there are only -6- defined column widths.
Adding a specific width for the 7th column fixed the problem.
Column Widths: 0″;1″;1″;1″;0.25″;1.5″;0.5″
There must be some difference between the way XP & Win7 handle drawing the list box and as a result, what was ok in xp did not work in 7. This isn’t a huge surprise but it was a bit obscure.
This kind of un-Google-able issue sometimes takes hours & hours to resolve. Surprisingly this only took me an hour to solve. And now maybe it’s no longer un-Google-able