Consulting

Results 1 to 4 of 4

Thread: Combo Box showing reports

  1. #1
    VBAX Regular
    Joined
    Apr 2007
    Posts
    36
    Location

    Combo Box showing reports

    Hello all

    Is it possible to have a combo box on a form, that will list all the reports held within the database, and then the user can select multiple reports to run at the same time.

    If it is possible can anyone give me a push in the right direction as to how to accomplish this

    Thanks in advance

    Mav

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Mav

    You can't make multiple selections from a combobox, for that you would need a listbox.

    If you do want to use a combobox try this.

    1 Create a new form.

    2 Add an unbound combobox and set it's Row Source property to this.

    SELECT [MSysObjects].[Name], [MSysObjects].[Type] FROM MSysObjects WHERE ((([MSysObjects].[Type])=-32764));

    3 Add a command button and add this for it's click event.
    [vba]
    Private Sub Command2_Click()
    DoCmd.OpenReport Combo0.Value, acViewPreview
    End Sub[/vba]

  3. #3
    VBAX Regular
    Joined
    Apr 2007
    Posts
    36
    Location
    Ta for the response

    However it is early and I am sure I am missing something in this code.

    When I put it in the code you suggested in the Row the report names do not come up, all I get is two options

    The first option I get it

    SELECT [MSysObjects].[Name]

    The second option I get is

    [MSysObjects].[Type] FROM MSysObjects WHERE ((([MSysObjects].[Type])=-32764));

    I am sure I need to change some of the code but I have still not had any coffee yet this morning and need another 6 hours sleep to fully function.

    Ta for the help

    Mav

  4. #4
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Mav

    You also need to change the Row Source Type to Table/Query.

Posting Permissions

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