Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Sub?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Skyarina - 24 Jul 2005 22:14 GMT
I will like to create three combo boxes (already done) in which each narrows
down the previous information inputted. ie. Categories: Cameras; Sub
Categories: Digital; Detail: Fuji, etc.  But if I change the Category to be
other (ie Clothing) the sub category and detail boxes will give only data
corresponding to the category selected?
Graham Mandeno - 24 Jul 2005 23:02 GMT
Hi Skyarina

You should filter the rowsource of each combo box according to its parent in
the hierarchy.

For example, say your  rowsource for cboSubcategory is:
   Select SubCatID, SubCatName from SubCategories order by SubCatName;

You need to add a WHERE clause:
   Select SubCatID, SubCatName from SubCategories
       where CatID=Forms!YourForm!cboCategory
       order by SubCatName;

Also, you need to requery the "child" combo boxes in the AfterUpdate event
of the parent ones:

Private Sub cboCategory_AfterUpdate()
   cboSubCategory.Requery
   cboSubCategory = Null
   cboDetail.Requery
End Sub
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

>I will like to create three combo boxes (already done) in which each
>narrows
[quoted text clipped - 3 lines]
> other (ie Clothing) the sub category and detail boxes will give only data
> corresponding to the category selected?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.