Solved

Access Requery

Posted on 2011-03-23
5
225 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:creativefusion
5 Comments
 
LVL 33

Expert Comment

by:Mike Eghtebas
ID: 35202594
Are these list boxes supposed to be synchrinized (each lisiting some criteria to select from)?
0
 

Author Comment

by:creativefusion
ID: 35203138
No nothing at all. They are just for information and contain two columns of data.
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 35203682
I think you have it right.  On form_load, populate the ControlSource property of the list boxes appropriately.
0
 
LVL 5

Expert Comment

by:DoveTails
ID: 35208294
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.
0
 
LVL 44

Expert Comment

by:GRayL
ID: 35216706
Thanks, glad to help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now