Results 1 to 7 of 7
  1. #1
    RodL is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    USA
    Posts
    3

    Create Report Based on Combo Box Selection Chosen by User

    Greetings Access Gurus,


    I am sure this will be simple for many of you, but I am struggling and appreciate assistance.


    End State Goal:


    I want a report to be created based on the choice the user picks from the options of a combo box - choose the option, click a button and the formatted report is presented to the viewer.


    What I have:


    I have a table named "Assets" that is populated with several fields, the field I want the report to be based on is the "Network" field. I have set the field up a short text with the lookup display control being a Combo Box, the row source is a value list, in the row souce I have 'Choose';'Network 1';'Network 2';'Network 3' and so on.


    I created a report that has all of the options I want to be displayed, it is called Network Type Report. I have an unbound combo box that has no control source selected, the row source is SELECT Assets_tbl.[Network] FROM Assets_tbl; and Row Source Type is Table/Query




    I created a form that has an unbound combo box, there is nothing in the Control Source, in the Row Source I've put the same info as I did in the unbound combo box on the report SELECT Assets_tbl.[Network] FROM Assets_tbl; and Row Source Type is Table/Query
    Under the form I have a button with the following VBA


    Code:
    Private Sub cmdOpenReport_Click()
    
        DoCmd.OpenReport "Network Type Report", acViewReport
    
    End Sub
    

    When the form loads and I try to click the combo box I get the following error:


    The record source '~sq_CSelect Network~sqcNetwork' specified on this form or report does not exist.
    The name of the recordsource may be misspelled, the recordsource was deleted or renamed, or the recordsource exists in a different database.
    In the Form or Report's Design view or Layout view, display the property sheet by clicking the Properties button, and then set the RecordSource property to an existing table or query.


    I have no idea where it is finding this information nor do I now how to code it to get it to do what I want it to do.


    Thank you so much for helping.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    This should help with the goal:

    http://www.baldyweb.com/wherecondition.htm

    To your error, I note one has a . and one has _

    SELECT Assets_tbl.[Network] FROM Assets.tbl

    The . would not be valid, so try

    SELECT Assets_tbl.[Network] FROM Assets_tbl
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    RodL is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    USA
    Posts
    3
    Paul,

    My apologies, I don't know what I put a ., both do have the underscore.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Does that SQL work in an independent query?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    RodL is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    USA
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    Does that SQL work in an independent query?
    Paul,

    Sadly no, now I am completely stumped.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 06-08-2020, 10:37 AM
  2. Replies: 5
    Last Post: 05-01-2017, 06:17 AM
  3. Replies: 1
    Last Post: 12-24-2012, 09:36 AM
  4. Replies: 1
    Last Post: 12-09-2012, 05:27 PM
  5. Replies: 5
    Last Post: 03-11-2011, 11:28 AM

Tags for this Thread

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