Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Business Applications Business Applications
Search Search
Search for:
Tech Support Guy > > >

Access 2010 and Combo boxes again


(!)

kazwaz's Avatar
kazwaz kazwaz is offline
Member with 98 posts.
THREAD STARTER
 
Join Date: Jun 2011
22-Jun-2012, 11:07 AM #1
Access 2010 and Combo boxes again
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
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,539 posts.
 
Join Date: Mar 2005
Location: UK
22-Jun-2012, 11:58 AM #2
Karen, a question first, are you using Access Macros or VBA Code?
kazwaz's Avatar
kazwaz kazwaz is offline
Member with 98 posts.
THREAD STARTER
 
Join Date: Jun 2011
22-Jun-2012, 12:57 PM #3
Hi,
I'm using VBA code.
Thanks
Karen
OBP's Avatar
OBP OBP is offline OBP is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 18,539 posts.
 
Join Date: Mar 2005
Location: UK
22-Jun-2012, 01:11 PM #4
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

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑