Link to home
Start Free TrialLog in
Avatar of creativefusion
creativefusionFlag for Australia

asked on

Access Requery

All,

I have an issue with "old" data appearing inside list boxes on a form.

The list boxes are named such as lstRange1, lstRange2, lstRange3 and so forth.

What happens is, I use VB to populate the list boxes when the form opens (as part of a refresh process), however, not all list boxes are populated depending on some conditions. For example lstRange1 might have data but lstRange2 and lstRange3 might not be required. These are greyed out.

My initial thought was to set each list box rowsource to "" on the FormLoad or FormOpen event to make sure that each of the list boxes were blank prior to populating the form with data. However, a colleage mentioned to me that I could use the requery method but I cannot pin point any solid examples as guidance.

Anyone got any suggestions?
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

Are these list boxes supposed to be synchrinized (each lisiting some criteria to select from)?
Avatar of creativefusion

ASKER

No nothing at all. They are just for information and contain two columns of data.
ASKER CERTIFIED SOLUTION
Avatar of GRayL
GRayL
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DoveTails
You'd use the requery to update the list boxes for the user if something has changed in the list (ie. an item added or deleted)
    ie.   Me.lstRange2.Requery

If you want the boxes to be blank for the user, then your idea of setting them to "" makes sense to me.

I think this is what GRayL is getting at.
Thanks, glad to help.