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 / February 2008

Tip: Looking for answers? Try searching our database.

Simple cascading Combobox's

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Graham - 27 Feb 2008 10:42 GMT
Still struggling with this!
I can make three selections in my first combobox, Resource, which I then
want to populate my second combobox, Capability, with data held in three
separate tables.
I think the first combo is working OK, but the second fails to update. I
think it may have something to do with the RowSource property for that second
combobox ?
Should this be automatically populated from the code below, in the
AfterUpdate property of my first box ?
Also the debug doesn't like the [Capability] on the 5th. line, I get the
error message "External Name not defined", I've tried all sorts of
permutations but to no avail. It is happy with "[Resource]" on the third line
?  
Can you specify whether you are referring to another Combobox or a Table
?Any suggestions ?

Private Sub Resource_AfterUpdate()
On Error Resume Next
Select Case "[Resource]"
Case "System Engineering Services"
[Capability].RowSource = "[SESPrimaryCapability]"
Case "Management Services"
[Capability].RowSource = "[MSPrimaryCapability]"
Case "Specialist Services"
[Capability].RowSource = "[SSPrimaryCapability]"
End Select
Me!Capability.RowSource.Requery
End Sub
NetworkTrade - 27 Feb 2008 19:44 GMT
you must add into ComboOne's 'AfterUpdate' event
me.ComboTwo.requery

this will refresh the second combo box.

presuming combobox2's underlying query has criteria defined in combo1 -
everything should work fine....

Signature

NTC

> Still struggling with this!
> I can make three selections in my first combobox, Resource, which I then
[quoted text clipped - 24 lines]
> Me!Capability.RowSource.Requery
> End Sub
BruceM - 28 Feb 2008 12:14 GMT
Instead of:
Select Case "[Resource]"
try:
Select Case Me.Resource

It may work if you just remove the quotes, but the quotes cause Select Case
to evaluate the literal string "[Resource]" rather than the combo box value.
The quotes are correct for each Case (assuming that "System Engineering
Services", etc. are from the combo box's bound column) and for the named
queries in the RowSource property.

> you must add into ComboOne's 'AfterUpdate' event
> me.ComboTwo.requery
[quoted text clipped - 34 lines]
>> Me!Capability.RowSource.Requery
>> End Sub
 
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.