Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Linking combo boxes to queries to reports

Discussion in 'Information Technology' started by KeffinJ, Jul 28, 2006.

  1. KeffinJ

    Expand Collapse

    Hi all,

    I have a table (CountryPop). It contains a list of 20 countries and the
    populations of those countries. I have another table (Rain) that contains a
    list of 20 countries and the average rainfall in that country.

    I have a form with 3 combo boxes. Each combo box has a list of 20 counties
    (sourced from CountryPop table).

    I want to be able to select 3 different countries from the combo boxes,
    which pulls up a report that tells me the populations and rainfall for each
    of the countires I selected from my form and also runs a total of the

    This is a very simplified version of what I am trying to do...but I kind of
    want to put it out there this way - there is a vital step that I am missing.
    I think that I can't get the selections from the combo boxes to interact with
    a query (I assume I base my report on this query).

    Can anybody point me in the right direction please?

  2. Loading...

  3. KeffinJ

    Expand Collapse

    Just so I don't waste anyone's time - I'm nearly there!

    I was trying to make things far too complex, and once I realized that,
    Doug's response from an earlier post made sense.

    The secret was in the query and the VBA. In the query's criteria operator I
    referred back to my form [Forms]![Form1]![ComboBox1] and also entered another
    line to refer back to the second combobox too [Forms]![Form1]![ComboBox2].

    When I ran the query, it ran it using the criteria that I had selected in my
    two combo boxes.

    I made a report, which sourced the query and I entered my relevant fields
    that I wanted to view.

    Back to the form, I wrote a simple VBA statement in the After Update box for
    the second combo box. The VBA simply directed Access to open up the report I
    had just authored.


    If there is a more efficient method, or if something is wrong with this way,
    then let me know. I am trying to learn as much as I can by trawling through
    the discussion boards!

    Thanks for your inspiration.

Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     

Share This Page