Announcement

Collapse
No announcement yet.

Microsoft Access - select query based on contents of combo box

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Microsoft Access - select query based on contents of combo box



    Good Afternoon,

    I have an access form with a combo box (combo_rule) that lists a number of queries.

    When I hit the run button, I woul like to run the query that has been selected in the combo box.

    Can anyone advise the best way to do this

    Thanks

    Mark

  • #2
    Mark

    You could use DoCmd.OpenQuery for that, something like this
    Code:
    DIm strQueryName As String
    
        strQueryName = Me![combo_rule].Value
    
        DoCmd.OpenQuery strQueryName, acViewNormal
    Note, you can change the 2nd argument View how you want the query displayed/what you want to do with it, see here for more information.
    Boo!

    Comment


    • #3


      Perfect!

      Thanks very much

      Mark

      Comment

      Working...
      X