Results 1 to 6 of 6
  1. #1
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    Open Report From a ComboBox

    I created a simple form that has a dropdown of all the reports that a user can select. I am using the following command;

    DoCmd.OpenReport "rpt_Roadshow2", acPreview, , "RoadShow.RSID = SelectSymbol.Column(0)"

    Where SelectSymbol is the name of the ComboBox and Column(0) is the first column of that data field. When I run it I get



    Run Time Error 3085
    Undefined Function 'SelectSymbol.Column" in expression.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The combo box "SelectSymbol" selects the NAME of the report?
    Then the command line should be

    Code:
    DoCmd.OpenReport Me.SelectSymbol, acPreview

    Are you also trying to set a WHERE condition?

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Oops... Hit the wrong button

    You get the error because you have to concatenate the value of the combo box to create the where condition. Access is trying to evaluate the where clause; Access tries to execute what it thinks is a function: SelectSymbol.Column(0).

    IF the bound column of the combo box was a number (not the report name) and you wanted to limit (filter) the records, the wherecondition you would use would look like:
    Code:
    DoCmd.OpenReport "rpt_Roadshow2", acPreview, , "RoadShow.RSID = " & Me.SelectSymbol

  4. #4
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    That worked, thanks. I do not need the were at this iime.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Great. Ready to mark this solved??

  6. #6
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    Yes. Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 06-19-2013, 08:01 AM
  2. Use combobox to select form to open
    By gemadan96 in forum Forms
    Replies: 11
    Last Post: 11-15-2012, 01:42 PM
  3. Replies: 1
    Last Post: 05-31-2012, 01:01 PM
  4. open form based on combobox
    By bigmac in forum Forms
    Replies: 3
    Last Post: 04-09-2012, 11:25 AM
  5. Replies: 1
    Last Post: 11-26-2010, 05:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums