|
-
May 11th, 2005, 01:15 AM
#1
Creating Cascading ListBoxes with MS Access and ADO Control
Hi Everyone,
Was wondering if I could get some help here.
I have a multi table database.
I would like to populate 3 listboxes with data from 2 of the tables and then move the ADO control depending on where the user selects items in the listboxes.
I can get the first listbox to populate just fine from the first table called "tblBOOK"
It has 2 fields, Book_ID and Book_Title. The first field has 66 entries and the 2nd field has unique names for each of those id numbers.
The 2nd table I am concerned about is called tblQUOTE and has Book_ID, Chapter, Verse, Quote.
The problem is, that Book_ID in tblQUOTE has multipe 1's 2's and 3's etc depending on its corrisponding Book_ID field in tblBOOK.
tblQUOTE is grouped with all the book titles that go with the number 1 in Book_ID would be considered the Book_Title in tblBOOK.
So lets say tblBOOK has a Book_ID of 1 and a Book_Title of Genesis.
so in tblQuote I would like all the 1's in tblQUOTE.Book_ID to relate to Genesis which is in tblBOOK.
The next listbox then would be set to use the Chapter field in tblQUOTE and be set to the number 1 grouped by the Book_ID field and the 3rd list box would use the Verse field and also be set to the number 1 grouped by the Chapter field.
What I dont want to see in the 2nd and 3rd listboxes are multiple 1's, 2's and 3's etc.
It would need to group the 2nd list box with only 1 representation of each chapter in the book Genesis. And the 3rd listbox would be only 1 representation of each verse in chapter 1 of book Genesis.
I then want the ado control to move to the correct area and put in a text box from the proper location in the database the contese of field Quote from tblQUOTE.
So, what I am looking for is subset's I guess but taking out the repeats.
Any ideas if this is even possible? And if so, any code suggestions.
What I have tried so far is using SQL queries but I cant seem to get the 2nd and 3rd boxes to populate without seeing multiple 1's, 2's etc.
If you havent guessed so far, yes its a bible reading program with a access database.
Any assistance would be appricated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|