Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2002
    Posts
    16

    Unanswered: Running a macro based on combo box value

    I want to have a combo box on a form that when a value is selected a macro is ran that opens a filtered form based on the value I select.

    For instance say the combo box contains colours and I select Red. I want this to then open a form with all the records filtered down to Red results.

    The macro I have currently to filter is the OpenForm action against the form I wish to open with the Where Condition field set to [Colours]="Red". I want to somehow replace Red with a variable that is linked to whatever I choose in the combo box?

    How do I do that? Anyone know??

    If this is not easy or there is any other easier way please can you suggest this?

    Thanks in advance

    Daz

  2. #2
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    [Colours]='" & Forms![FormName]![ComboBoxName].Column (0) & "'"

  3. #3
    Join Date
    Oct 2002
    Posts
    16
    I apologize for being thick now but what do I do with that?

    I can just about set up a simple database but when it comes to code or fancy macros I'm a bit lost.

    Thanks

    Daz

  4. #4
    Join Date
    Oct 2001
    Location
    Chicago
    Posts
    440
    Replace your macro's current where condition
    >>Where Condition field set to [Colours]="Red"

    with

    [Colours]=Forms![FormName]![ComboBoxName]

    (syntax is diff. than previous post - I don't use macros)

    Let me know if you need more help.
    Matt

  5. #5
    Join Date
    Oct 2002
    Posts
    16
    Excellent!!!
    Thanks for your reply.
    It works great!!!

  6. #6
    Join Date
    Mar 2002
    Location
    NYC
    Posts
    5

    Arrow Opening particular form based on combo box

    My problem seeems to be related to this thread except instead of filtering I want to open particular forms based on a user's selection from a combo box. Am I just being dense and missing something obvious?
    Thanks in advance for any help.
    PAC

Posting Permissions

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