Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Requery

Posted on 2011-03-23
5
Medium Priority
?
246 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

604 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