Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter a Listbox 1

Status
Not open for further replies.

jimb0ne

Programmer
Oct 6, 2003
291
0
0
CA
This is pretty newbie, but its been awhile since I've been at access.

Basically I have 2 different tables, one called Programs and one called subprograms. My program table contains the TITLES of programs, eg, health, land development, etc. as well as a unique number identifying each program title. The subprogram table stores A. The number related to the title of the program B.The number of the related entry in my main table, and finally the text string to be displayed for said program.

The reason I need to do this is because in my DB people can add new program titles, and then create entries under any of these program titles for each entry within the database. Example: I have an organization, they have 5 programs they operate, and within these 5 programs they have a number of different specific areas, all of which need to be indicated in my DB. I am trying to create a listbox which will only display the Program titles, and not create duplicate entries. My problem is that I can't just have the listbox show entries for a specific organization ID, it shows all entries. If I could somehow just say "if entryID = number" that would do the trick, but I can't figure out how to do that on a listbox. sorry about the confusing explanation, happy to clarify.

thanks in advance,
jimb0ne
 
Isn't that handled in the listbox.rowsource?

listbox.rowsource = "SELECT DISTINCT ProgramTitle FROM Programs WHERE entryID = number
 
You are the man. I knew it was somethign easy, I was about to go ahead and try to do everything in code. Im also workign in spanish access so the help is pretty useless (my spanish isn´t quite good enough to make sense of it). thanks a million guy.

jimb0ne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top