little problem

a.mlw.walker

Registered User.
Local time
Today, 11:18
Joined
Jun 20, 2007
Messages
36
Hi,
I have a huge table full of records, with a column called sectors, and sub sectors. For instance if the sector is animals, a sub sector(activity as i am calling them) could be a vet.

On my form, I have a combo box for selecting the sector, what i want is another combo box for selecting the activity/sub sector but i have 1000 sub sectors, so i want the combo box to only show me the sub sectors/activities that go with the sector.

Please can someone show me how?

Thanks

Alex
 
Sounds like you are going to need a table where you attribute each sub-sector to a sector. Then you can query this tables to filter to the required Sector. If your sub-sectors are not 1 to 1 then no matter; just make an entry for each. The filter will still work.
 
Heres a VB example (Also has a Requery) on the second combi:

Combi 2:

Function LookupSector()

Dim MyControl As Control
Set MyControl = Screen.ActiveControl

With CodeContextObject
MyControl.RowSource = "SELECT .... WHERE SubSectors.[Sector]= '" & .[Sector];"
Call ListDisplay
End With
End Function

You can does this without VB by referencing Form and combi1 in the Where Clause.

Simon
 
Thanks for replying. but my vb is not great so... what do i do with it, run it as a macro?

How can I attribute each sub sector to a sector. I have a table with all the sub sectors next to there relevent sector, can i use this to do what i am trying to do, or have i missed the point.
 
It depends how you are accessing the information:

From a query there is Build once in the Criteria section also this is restrictive as it binds the Query too tightly.

From Docmd Macro there is an Expression builder.

From a Form to Subform it would be Link Child / Master Fields

Tip Convert Macro into VB.

Simon
 

Users who are viewing this thread

Back
Top Bottom