Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

dynamic listbox

ResolvedVersion 2007
Edited on Fri 3 Jun 2011, 12:44

Robert has attended:
Access Advanced course

Dynamic listbox

Is it possible to dynamically change the values in a listbox based on the value selected in another listbox in the same form?

What I want to do is to be able to select a sub-section in list 2 after first selecting the main section in list 1.

Any help greatly appreciated.

RE: Dynamic listbox

Hi Robert, thanks for your query. It is possible, but you'll need to do it in VBA. What you're trying to do is capture the event that occurs when you choose an option in the first listbox, and use that to trigger the population of the second.

Hope this helps,

Anthony

RE: Dynamic listbox

Thanks Anthony.

I put an 'on click' event on the first listbox that requeried the second listbox. This seemed to work ok because the selection criteria of the second listbox was based on the selected value in the first one.

RE: Dynamic listbox

Excellent! Glad it worked!

Anthony

Access tip:

Random sampling

Data is th key to a good database, therefore checking is essential.

A good way of checking data is by random sampling. You can do this in a query, by typing the follow:
1) In the Field box create a RandonID field eg. Randon Id: Rnd(fieldname])

2) sort the field
3)Right click and chage the properties for To value to be the number of randon records you want to see.

4) Change the set to Show row for Randon ID to be False, add all the other fields you want to see and the run the query.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.