473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

After Update Run Macro

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.

Dec 4 '06 #1
5 3717

I have now worked out the DoCmd.RunMacro to run the macro as described
above however the 2nd combo box isn't populating with the query
results.

If i run the query on it's own I am prompted to "Enter Parameter Value"
and f I enter an outer postcode the query run's perfectly.

What am I doing wrong?

Dec 4 '06 #2

Sorry for continually updating this post. I am euphoric asI have now
got the 2nd combo box to show the customer details working!

However I cannot select from the combo box. I want to populate fields
on the form with these details but the list just drops down and I
cannot make a selection. Please tell me how stupid I am being and where
I am going wrong!

Dec 4 '06 #3
Make sure that in your form properties you have "Allow Edits" enabled.

Cheers,
Jason Lepack

keri wrote:
Sorry for continually updating this post. I am euphoric asI have now
got the 2nd combo box to show the customer details working!

However I cannot select from the combo box. I want to populate fields
on the form with these details but the list just drops down and I
cannot make a selection. Please tell me how stupid I am being and where
I am going wrong!
Dec 4 '06 #4

"Allow Edits" is set to Yes! What else can i try?

Dec 4 '06 #5

I really need to try harder before I start posting!

Finally I have worked it out - I had put the query in control source
(as well as row source) by accident!

Thanks for all the help anyway.

Dec 4 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: chfran | last post by:
I have a form (continuous form) that based on the underlying query can be huge or small. When a user updates any part of the record, either the first, third, or last control, I want to update the...
1
by: ghadley_00 | last post by:
Hi, I have a MS access database table for which I regularly need to import fixed width text data. At present I have to to cut and paste the text data from its source to a text file, save the...
7
by: Nerrad | last post by:
Hi, i am currently working on a project which requires me to create a form to allow the user to change their password. I know there is a user-level security login which is easier and safer but...
4
by: MN | last post by:
I have to import a tab-delimited text file daily into Access through a macro. All of the data needs to be added to an existing table. Some of the data already exists but may be updated by the...
0
by: jhicke03 | last post by:
Hi, This problem has been bugging me for a while. In my form's before update field i have the following code: Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.Nominator_name = "" Or...
1
by: jhicke03 | last post by:
Hi, This problem has been bugging me for a while. In my form's before update field i have the following code: Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.Nominator_name = "" Or...
1
by: gchris53 | last post by:
Hello, Any advice on the attached would be greatly appreciated. I am currently customising someone elses database and have the following problem. A date is updated on a form, in database...
1
by: HenHouse | last post by:
Hi all; I think I've asked this question before but it looks like I'm going to need a deeper understanding of the problem rather than just a quick fix... I have three tables represented by three...
7
by: luciquar | last post by:
I am a PhD student in demography and I am working with a Microsoft Access database in which I have to use several update queries. Amongst these there are some in which I have to update the value of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.