Listbox Double Vision

D

Dave

Good day;
I am using Access 2003 with Windows XP. I placed a listbox on a form. I
want the listbox populated with values 1 thru 60. So when the form loads it
runs this piece of code.
With lstGetMailTimer
.RowSourceType = "Value List"
sSrceStr = vbNullString
For iLoop = 1 To 60
sSrceStr = sSrceStr & CStr(iLoop) & ";"
Next ' iLoop
.RowSource = sSrceStr
End With

The listbox does populate correctly, but what happens is I am getting a
second listbox directly above my listbox with no values in the list. When I
drop the form into design mode, an error occurs causing Access to crash. I
deleted the listbox and created a new listbox using a different name - same
result. Any ideas what may be causing this? Thank you.
 
K

Klatuu

It may or may not be the actual problem, but the only thing I see is you are
not qualifying your object.

You should be using:
With Me!lstGetMailTimer

And it should be in the Load event. If by chance you are doing it in the
Open event, that could contribute the the problem.

The reason I am thinkig object reference and, perhaps, the correct event, is
because you are seeing an additional list box on you form. It may be that
Access doesn't yet know exactly what listGetMailTimer is, so it creates an
additional list box on its own.
 
D

Dave

Klatuu

You know other than not using Me!, this type of code I have used in other
projects. The only difference is normally I use a combobox. Most users
(here anyway) don't understand that they have to actually click on the value
they want to select it. I find a combobox works best. Anyway I tried a
combobox with no ghost image appearing. Also in my internet travels noted
that developers of other languages are experiencing similiar issues of
listbox bleeding through or having a ghost image. Must have something to do
with that control. I just didn't want to type 60 values into the box. This
is something to keep an eye out for. Thank you for your input.
 
K

Klatuu

Interesting. I will keep an eye out. I have not heard of any issues with a
list box control before. I really only use them when a Multi Select
situation is called for; otherwise, a combo box is a better choice (IMHO).
Do you have Office 2003 SP3 installed and if so, have you applied the hotfix?
 
D

Dave

This was the very first time running into that situation. But like I said, I
normally use Comboboxes. My Access version is 2003 (11.8166.8202 SP3). We
had some updates recently, but don't know if any were hotfixes. Do you have
the hotfix number?
 
D

Dave

I'm up to date with the fixes. I may have come across one of those error
issues some time ago. I have Office 2000/3 loaded on the computer to support
both systems running in the company. Once in a while that creates its own
issue. Just have to keep an eye out for that ghost listbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top