Results 1 to 8 of 8
  1. #1
    JMZLR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    30

    Wasted Two Days On A Report And Combo Boxes

    Hi;


    I created a report with a Combo Box in a Group Header and other fields in Details.


    Looks like this:
    tbl_Tool: Holds all the info about my tools with a Combo Box to select a Category.


    tbl_Category: Contains the name of all the different Categories, Sockets, Hammers, ect.


    The Report is based on a Category, but no matter what I do I cannot sort it. I don't
    know any other way to Sort it. If I create a Table and place the same Category names in
    it and change the Control Source of the Combo Box in the Report to the new table it works.
    But I need to use the Combo Box in tbl_Tool.


    Can anyone tell me if sorting a Combo Box in a Report is possible? If not what other was is there.

    Thank you


    Jim

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you dont put combos IN the report. (useless)
    you put them on a form, to use as criteria, then open the report using the form options selected.

    Code:
    sub btnReport_click()
    Code:
    sWhere = "1=1"
    if not isnull(cboState) then   sWhere = sWhere & " and [state]='" & cboState & "'"
    if not IsNull(txtName) then    sWhere = sWhere & " and [Name]='" & txtName & "'"
    if not IsNull(cboGender) then    sWhere = sWhere & " and [Gender]='" & cboGender & "'"
    
     DoCmd.OpenReport vRpt, acViewPreview,,sWhere
    end sub
    

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I was unable to get a combo to show in a report?
    However sort order can be carried out by reviewing this link? https://docs.microsoft.com/en-us/off...form-or-report

    I have generally just done it via the report statically, never dynamically.

    HTH

  4. #4
    JMZLR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    30
    ranman256

    Thank you for responding. But I have to tell ya, the only words I understood in your reply was,
    "you dont put combos IN the report. (useless)".

    Jim

  5. #5
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    2 days.

    Reports are for reading/printing. They are not interactive.
    You use a form to select parameters (interaction) in order to open a report with those selected criteria.

  6. #6
    JMZLR is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2020
    Posts
    30
    orange;
    The Reports need to be printed. I will create a Form as you suggest and hope I can get it to work.
    I also thought about looking at adding another field in the Table "Category_2" to see if it can populate with the contents the Combo Box "Category_1".
    There are probably a million different ways to fix this problem programmatically and I seemed to have chosen the only wrong way to do it.
    Because of my nature and background, I have spent a lot of time on this problem. not knowing about the Combo Box/Report issue.

    Thank you
    Jim

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You will probably find that forms don't print very well and they have no grouping or group level sorting. Perhaps you should explain what the report is supposed to support and the process that determines what to load in it because I might be able to speak for the rest of us when I say that it's a puzzle as to why you think you need interactive controls on a report.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    See this link (the original Dynamic Reports site has been archived apparently) and review the 1-16 pages at the top of the linked page. Suggest you go full screen to read and review the details.
    There is a sample database as I recall.

    You may also find some youtube videos on MS Access Reports.

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

Similar Threads

  1. Report based on combo boxes
    By Shaun in forum Reports
    Replies: 1
    Last Post: 06-29-2016, 11:03 PM
  2. Create a Report Using Combo Boxes
    By kingofthekassel in forum Reports
    Replies: 3
    Last Post: 08-06-2015, 12:52 PM
  3. Replies: 11
    Last Post: 08-06-2014, 09:47 AM
  4. Replies: 3
    Last Post: 04-24-2013, 02:41 PM
  5. Replies: 1
    Last Post: 07-02-2012, 02:53 PM

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