Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-11-2010, 11:06 AM
Ollie_3670 Ollie_3670 is offline
Registered User
 
Join Date: Feb 2010
Location: Sheffield, UK
Posts: 50
Ollie_3670 is on a distinguished road
Reports in a Combo box (Simple)

Wasn't sure if this was a form or reports question, but eitherway, how do you put reports into a combo box? I've been able to successfully google how to look up records from a table in a combo box, now I need to be able to give a drop down list showing several reports

In my modify staff form, I want to show all reports that are based on staff, and when they are selected the reports are executed. Currently this totals a grand total of 1 report. But the ability for this to auto update when I add more staff reports would be useful

However, as a patchup job if someone simply knew how to do it without auto-updating the cbo.

Thanks!
Reply With Quote
Sponsored Links
  #2  
Old 02-11-2010, 11:08 AM
SOS's Avatar
SOS SOS is offline
Registered Lunatic
 
Join Date: Aug 2008
Location: Somewhere between here and there
Posts: 3,299
SOS is just really niceSOS is just really niceSOS is just really niceSOS is just really nice
Re: Reports in a Combo box (Simple)

I like Bob Larson's list box sample (which can be done using a combo as well) and you can modify it so that it fits your situation. But essentially by using a certain prefix the report will automatically be added to the list.
Reply With Quote
  #3  
Old 02-11-2010, 11:47 AM
Ollie_3670 Ollie_3670 is offline
Registered User
 
Join Date: Feb 2010
Location: Sheffield, UK
Posts: 50
Ollie_3670 is on a distinguished road
Re: Reports in a Combo box (Simple)

Looks like exactly what I want, (I'd start all mine with RptStaff_ or the like)

However I don't quite understand the query he uses as the row source of the list box.

I understand that a field has to contain the criteria "rpt_" but I don't know or understand what ''Left([Name],4)'' means.

That sysObjects database is so confusing! I understand Name is a field in it, which describes the type of object (perhaps?) but other than that..totally at a loss

Do I even need to understand it? Could I just copy and past straight from it into my database?
Reply With Quote
  #4  
Old 02-11-2010, 11:55 AM
SOS's Avatar
SOS SOS is offline
Registered Lunatic
 
Join Date: Aug 2008
Location: Somewhere between here and there
Posts: 3,299
SOS is just really niceSOS is just really niceSOS is just really niceSOS is just really nice
Re: Reports in a Combo box (Simple)

The Left part gets the first 4 characters from the name and the criteria of

rpt_

means that if that left 4 characters is rpt_ then it will include it in the list. If not, it won't. So to have the report show up in the list you just name your report

rpt_WHATEVER HERE and then it will show up in the list (without the rpt_ part).

You could copy it in and use it.
Reply With Quote
  #5  
Old 02-11-2010, 12:27 PM
Ollie_3670 Ollie_3670 is offline
Registered User
 
Join Date: Feb 2010
Location: Sheffield, UK
Posts: 50
Ollie_3670 is on a distinguished road
Re: Reports in a Combo box (Simple)

this is a shame! tried it with a list box first, worked a charm, then tried it with a combo box and for some reason with a combo box it doesn't block out the "rpt_"

this poses a little problem as the list box demands more space, where as a combo box i expandable

any ideas? Or should I bite the bullet and use list boxes?
Reply With Quote
  #6  
Old 02-11-2010, 12:32 PM
SOS's Avatar
SOS SOS is offline
Registered Lunatic
 
Join Date: Aug 2008
Location: Somewhere between here and there
Posts: 3,299
SOS is just really niceSOS is just really niceSOS is just really niceSOS is just really nice
Re: Reports in a Combo box (Simple)

Quote:
Originally Posted by Ollie_3670 View Post
this is a shame! tried it with a list box first, worked a charm, then tried it with a combo box and for some reason with a combo box it doesn't block out the "rpt_"

this poses a little problem as the list box demands more space, where as a combo box i expandable

any ideas? Or should I bite the bullet and use list boxes?
You just have to make sure to set the combo box properties correctly.

First, use the same row source as the list box.

Second, set the COLUMN COUNT to 2 and the Bound Column to 1.
Reply With Quote
  #7  
Old 02-11-2010, 12:35 PM
SOS's Avatar
SOS SOS is offline
Registered Lunatic
 
Join Date: Aug 2008
Location: Somewhere between here and there
Posts: 3,299
SOS is just really niceSOS is just really niceSOS is just really niceSOS is just really nice
Re: Reports in a Combo box (Simple)

Actually, you could just select the list box while in design view and go to FORMAT > CHANGE TO > Combo Box.
Reply With Quote
  #8  
Old 02-11-2010, 12:44 PM
Ollie_3670 Ollie_3670 is offline
Registered User
 
Join Date: Feb 2010
Location: Sheffield, UK
Posts: 50
Ollie_3670 is on a distinguished road
Re: Reports in a Combo box (Simple)

I thought that too, but I can't seem to see where that is, not sure if the option is available (using access 2007 by the way)
Reply With Quote
  #9  
Old 02-11-2010, 12:51 PM
SOS's Avatar
SOS SOS is offline
Registered Lunatic
 
Join Date: Aug 2008
Location: Somewhere between here and there
Posts: 3,299
SOS is just really niceSOS is just really niceSOS is just really niceSOS is just really nice
Re: Reports in a Combo box (Simple)

Quote:
Originally Posted by Ollie_3670 View Post
I thought that too, but I can't seem to see where that is, not sure if the option is available (using access 2007 by the way)
Oh, in 2007 you select the control and right-click and you should see the CHANGE TO on the popup menu.
Reply With Quote
  #10  
Old 02-11-2010, 01:01 PM
Ollie_3670 Ollie_3670 is offline
Registered User
 
Join Date: Feb 2010
Location: Sheffield, UK
Posts: 50
Ollie_3670 is on a distinguished road
Re: Reports in a Combo box (Simple)

Excellent it works! Thanks!
Reply With Quote
Sponsored Links
Reply

Tags
auto open, auto update, combo box, reports

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascading Combo Box - Assistance JPW General 2 05-07-2008 06:18 PM
Combo Box on Toolbar shadow9449 General 2 10-02-2007 09:01 AM
Cascading Combo Box Problem clf Forms 1 06-23-2004 06:07 PM
Problem closing a form with a combo box linked to a list box. Essendon Forms 1 04-10-2002 02:37 AM
Combo Box to Print/Preview Reports LisaP Forms 3 01-12-2001 09:08 AM


All times are GMT -8. The time now is 09:39 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World