List Box Scroll Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm using Access 2003 and I experience problems with List Boxes not
scrolling properly after switching between Form View and Design View.

When I first open the form, the List Box scrolls properly. If I then switch
between views and try scrolling my List Box it only highlights the area where
the cursor is pointing. Switching views again does not correct the problem. I
have to close and reopen the form to resume normal action on the List Box.

This is not good because my List Box has code that when an item is selected
a new record is appended to a table.

As an experiment, I created a new database file with nothing but a blank
form with a List Box on it. Sure enough, the problem repeats itself.

Is there a fix for this, or has anyone else experienced this bug.

-Simon
 
I'm using Access 2003 and I experience problems with List Boxes not
scrolling properly after switching between Form View and Design View.

I'm not sure if this is what you're looking for, but in my experience the
scrolling in the listbox improves if the program is forced to read the
number of lines in the listbox. So for example after appending to the
listbox I'd use

me.listboxname.requery
Dim l as long
l = me.listboxname.listcount


Not sure if this can help you.
 
Jesper,

I'm not sure what section of the List Box event to put your code. I tried
the AfterUpdate, BeforeUpdate, MouseUp and MouseDown section but keep getting
an error message that says:

Run-time error 2118:
You must save the current field before you run the Requery action.

-Simon
 
Jesper,

I noticed that after getting the error message if I just click "End" the
list box returns to normal scrolling again.

I was thinking that if I could somehow trap the error to prevent the error
popup window from appearing, then everything would work out fine. Is there a
way to do this?

-Simon
 
Back
Top