?
Solved

Access Requery

Posted on 2011-03-23
5
Medium Priority
?
240 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 34

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 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

777 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