Pesky Combo Box relationship...

Nightowl4933

Tryin' to do it right...
Local time
Today, 10:42
Joined
Apr 27, 2016
Messages
151
I have been lloking across the web for some guidance on this, but I haven't found anything I can 'butcher' to do what I would like to do, but hopefully this will be my last question (for a dat or two, anyway :o)

I would like to limit the vaalues of a second ComboBox to be based on the value of the first one, but I'm getting my knickers in a twist. :confused:

Firstly, do I have to use different tables/queries for each ComboBox?
Secondly, can I mix and match tables and queries to filter the values?

I have a list of Authorities and within each Authority is a number of Towns. Some Towns can be in two Authorities.

I would like to use Authorities as the master ComboBox and Towns as the slave.

The fields in the Authorities table ([tblAuthorities]) are [ID] and [Authority]
The fields in the ([tblEverything]) are [Authority] and [Town] but this table is quite large and is an imported Excel spreadsheet. The [tblEverything].[Town] field hasn't been set up as a separate table, but the [tblAuthorities] has. It only contains the two fields mentioned above.

This does sound simple enough to me, but I haven't got it to work, yet.

Help :eek:

Pete
 
the second combo box query, is based on the 1st one.
select * from table where [field] = '" & cboBox1 & "'"

be sure to .requery it to refresh the list in cboBox1 afterupdate event

Code:
sub cboBox1_afterupdate()
    cboBox2.requery
end sub
 

Users who are viewing this thread

Back
Top Bottom