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 / New Users / January 2005

Tip: Looking for answers? Try searching our database.

populating a second combo box depending on the first combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
King Kaos - 23 Jan 2005 02:20 GMT
Can someone help me,  I've looked at several samples of this type cbo on a
form but I can not get this to work.  I have a table called Type - which has
the fields of TypeGen and TypeSpe  (these stand for Type-general and
Type-Specific).  In this table I have several books names and books type
(for example I have TypeGen "Sci-Fi" and TypeSpe "2001 a space odyssey").  I
want to set up my form so when I select Sci-Fi from TypeGen I get a list of
the Sci-Fi books in the second combo field.   I created a query (QType) with
the control source related to the "TypeGen" field in my form.  I then Set
TypeSpe RowSource to be related to this query.  I did a requery command in
the AfterEvent on the TypeGen field.  But this still doesn't work for me.
It always goes back to the first record in the table and only use the
TypeGen field from the first record.  - does this make sense.  Can anyone
help me with this

Thanks

Keith
PC Datasheet - 23 Jan 2005 03:06 GMT
Create a query named QryTypeGen based on your table and only include the
field TypeGen. Set Sort ascending. For the first Cbo, make this query the
rowsource. Set the Bound Column 1, Column Count 1 and Column Width 1.5. Name
the Cbo CboTypeGen. Create a second query named QryTypeSpe based on your
table and include TypeSpe in the first field and TypeGen in the second
field. Set the criteria for TypeGen as:
Forms!NameOfYourForm!CboTypeGen. For the second Cbo, make this query the
rowsource. Set the Bound Column 1, Column Count 1 and Column Width 2.5. Name
the Cbo CboTypeSpe. Enter the folowing code in the AfterUpdate event of
CboTypeGen:
Me!CboTypeSpe.Requery
Me!CboTypeSpe.SetFocus
Me!CboTypeSpe.DropDown

--
                                       PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
                             resource@pcdatasheet.com
                                www.pcdatasheet.com

> Can someone help me,  I've looked at several samples of this type cbo on a
> form but I can not get this to work.  I have a table called Type - which has
[quoted text clipped - 13 lines]
>
> Keith
King Kaos - 23 Jan 2005 20:41 GMT
you are a god - I have been working on this for several days to have this
form complete a simple task

thank you

Keith

> Create a query named QryTypeGen based on your table and only include the
> field TypeGen. Set Sort ascending. For the first Cbo, make this query the
[quoted text clipped - 41 lines]
>>
>> Keith
 
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.