Listbox filtering

  • Thread starter Thread starter AccessFreak via AccessMonster.com
  • Start date Start date
A

AccessFreak via AccessMonster.com

I have a training database with two listboxes (lb001 and lb002). The main
record is based on a trainee's personal information. 'lb001' has a complete
listing of all trainings available. 'lb002' has a list of trainings
assigned to that associate (this is associated to another table). Here's
what I need:

lb001: lb002
-------- ---------
Fire
Water
Earth
Wind

I select 'Fire', 'Water', and 'Earth' to be added to the "Assigned Trainings"
list (lb002). I click "Add" and I am able to show the 'Fire', 'Wind', and
'Earth' records in lb002. What I need is for lb001 to filter out the 'Fire',
'Wind', and 'Earth' records and only show 'Wind'.

lb001 lb002
--------- ---------
Wind Fire
Water
Earth

I am doing this to prevent a user from creating duplicate entries in lb002.

Let me know if this is clear as mud. Thanks!
 
Your query for lb001 should be an outer join (show all records in lb001 and
only those from lb002 where the joined fields are equal). Include the
primary key from lb002 and add a where criteria to only show rows where the
lb002's primary key is null.

There is an example of this on my website in the Select Records sample
database:

http://www.daiglenet.com/MSAccess.htm

Look at frmClassPersons and frmPersonClasses to see examples of this.
 
Back
Top