Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2007
    Posts
    7

    Unanswered: Report Menu with Listbox

    1. Facility Combobox (cbo Facility)

    2. Report Listbox

    SELECT [tbl_ReportsProd].DBReportName, [tbl_ReportsProd].MenuReportName, [tbl_ReportsProd].FacilityID FROM tbl_ReportsProd WHERE (((tbl_ReportsProd.FacilityID)=Forms![MenuReport]!cboFacility));

    3. User Selects Date Range...txtDateFrom....txtDateTo

    4. Command Button "View Report"

    I am having difficulties coding the button to open the report chosen in the listbox.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    DoCmd.OpenReport <reportName>
    ?
    George
    Home | Blog

  3. #3
    Join Date
    Dec 2007
    Posts
    7
    How do I reference <reportname> to the list box. The list box value will obviously change depending on which report the user selects to view, thus <reportname> must change also.

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Me.reportListBox.Value
    George
    Home | Blog

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Code:
    DoCmd.OpenReport Me.<listboxname>
    I never use listboxes though... inefficient imo :P
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Dec 2007
    Posts
    7
    First of all, thanks for the responses...problem was solved.

    Just out of curiosity, what do you think makes list boxes inefficient?

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    They take up too much space. They have their uses... I think I just don't like them
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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