Results 1 to 2 of 2
  1. #1
    Join Date
    May 2012
    Posts
    33

    Unanswered: Run query from event

    Hi.

    I have a form with two comboboxes. Each combobox is attached to a table for lookups. So I like to filter the contents in lookup table in combo2 dependent on the selection on the combo 1.

    The table connected to combo2 has 2 columns. I only show column 1 in combo. The other has attached a label with same as table for selection on combo 1.

    So I came up with this query:
    PHP Code:
    SELECT SubSystem.SubSystemSubSystem.MainSystem
    FROM SubSystem
    WHERE 
    (((SubSystem.MainSystem)=[Forms]![Input]![MainSystem]))
    ORDER BY SubSystem.SubSystem
    This query is found under data, row source. It looks like it runs only once when I open the database form first time. I like this to run everytime I chenge a selection on combo 1.

    How to do this?

    Thanks

  2. #2
    Join Date
    Oct 2009
    Posts
    204
    Place this in the After Update event of combo1
    Code:
    Private Sub combo1_AfterUpdate()
    me.refresh
    end sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •