1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2010 and Combo boxes again

Discussion in 'Business Applications' started by kazwaz, Jun 22, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. kazwaz

    kazwaz Thread Starter

    Joined:
    Jun 29, 2011
    Messages:
    98
    Hi Guys, me again...

    Still working on my database and combo boxes.

    At the moment I have a combo box [SelectReportList] that lists all the available reports to run.
    I also have 2 combo boxes [SelectSupplier1] and [SelectSupplier2]that allow the user to select a supplier based on what report is selected in the first combo box. These 2 combo boxes are visible or not depending upon which of the 2 reports in box one are selected. To make the form tidy I have layered the two combo boxes on top of each other. As far as the end user is concerned, if they select a report where they have to choose a supplier, they see the combo box to select the supplier. I know its a bit 'clunky', but for only 2 reports it works.

    However, I was hoping that I could replace these 2 combo boxes [SelectSupplier1] and [SelectSupplier2]with just one [SelectSupplier3]that displays the suppliers and runs the relevant report.

    i.e.
    If the user selects Supplier Report 1, the suppliers are displayed in the new combo box. When the user selects the supplier, Supplier Report 1 is generated.
    If the user selects Supplier Report 2, the suppliers are displayed, but when the supplier is selected Supplier Report 2 is generated.

    I've been experimenting with Select Case and the RunSQL commands in the code builder but can't find a way to get it to work. I need the code to tell 'it' that whatever is selected in [SelectSupplier3] runs the SQL in the RowSource property for the two reports in question.

    Any ideas?
    All assistance gratefully accepted.
    Karen
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Karen, a question first, are you using Access Macros or VBA Code?
     
  3. kazwaz

    kazwaz Thread Starter

    Joined:
    Jun 29, 2011
    Messages:
    98
    Hi,
    I'm using VBA code.
    Thanks
    Karen
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Then you should be able to replace the 2 combos with one combo.
    You can use the Case function, but I just use the old If Then or If Then Else.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1058127