Hi,
I am struggling to learn access and VBA whilst creating a db, progress
is slow!
So far I have managed to run cascading combo boxes on a form by using a
sub in the after update procedure of the 1st combo box to populate the
second, using code like below.
Select Case combo1.value
Case "1"
Combo2.Rowsource = "bla"
And this has worked because in that situation there was a limited
number of choices in combo1.
However I now need to populate a combo box where there are a massive
amount of choices in combo1, so I cannot use the method above without
creating loads of tables.
The idea is to select an outer postcode (eg. IP1, IP23 etc) from
combo1, and combo2 will populate with all the customers in that
postcode area.
I have tried the below but this may be totally the wrong method, and
even if it is the right way to do it I can't get it to work.
I created a query showing the customer details and the outer postcode.
In the Outer postcode criteria i put
[Forms]![AllCustomers]![Combo1]
(Eg it will show all accounts where the Outer Postcode matched what is
enetered in the 1st combo box on the form).
I set the row source of combo 2 to be this query.
Then I created a macro to ReQuery this Query.
Then in the after update of the 1st combo box I want to run the macro I
have created. This is the part I can't do.
Any suggestions as to whether I am going about this the correct way
would be appreciated, and also how to run this macro from the after
update of my 1st combo. I tried the RunMacro in a sub in VBA but i
think I must be getting the arguments wrong.
Thanks everybody.