Results 1 to 15 of 15
  1. #1
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22

    Report based on fruit variety

    I haven't created a report that is based on specific criteria such as fruit variety which I have been asked to do.

    The user would like a report of season to date fruit hauled by variety. A table is populated of fruit hauled daily and I need to specify for example create a report for season to date say "gala". Is that accomplished through a form which then ties in somehow to the report. I'm drawing a blank.



    Thanks for any help you can offer. I have the report of season to date of all fruit and I have a combo box of different varieties; I just need to tie them together. Thanks ever so much.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What do you mean by 'report of season to date fruit hauled by variety' - a report that lists records grouped by variety? Use report Sorting & Grouping design features.
    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
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22
    I am aware of the grouping, etc., what I would like to accomplish is to have a drop down or something that the user can select the fruit variety so if he only wants to see for instance "Gala" Apples and not all apples, just the one variety reflected on the report.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Have combobox on form and then open report filtered by selected item.

    DoCmd.OpenReport "report name", , acViewPreview, "Fruit='" & Me.textboxname & "'"
    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.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    This type of request --- a general report format that can be customized -- is often handled with an initial form with a dialog to get report parameters from the user, then a submit Report button to produce the custom report.
    See Dynamic Reports for info and example.

    Good luck.

  6. #6
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22

    Needing further clarification

    Quote Originally Posted by June7 View Post
    Have combobox on form and then open report filtered by selected item.

    DoCmd.OpenReport "report name", , acViewPreview, "Fruit='" & Me.textboxname & "'"
    I am sorry; I really need help a little further with this. I have created a form "frm_variety", it has a combo box with the different varieties possible, Im not sure where I use the cmd verbiage, in the "open report" in the attributes of the report? thank you so much.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Could put it in the AfterUpdate event of combobox. Find the AfterUpdate event property, select [Event Procedure], click the ellipsis (...) to open VBA editor, type code in the procedure. Or build [Embedded Macro]. I don't use macros.
    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.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Did you look at the material from Martin Green's Dynamic Reports -the link I gave in post #5?

  9. #9
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22
    I have been trying but haven't gotten success yet. I created a form, did all the parameters for such a form, not 100% understanding the code. The combo box I created is "cmb_var" so in the after update in properties of the combo box I did an expression:
    Do.Cmd.OpenReport "Season to Date Haul Report", , acViewPreview, "Variety="' & Me. [Cmb_Var] & "'" and am receiving a "The expression you entered contains invalid syntax"
    This is my first exercise trying to do this sort of thing so please excuse my naivety, I really want to learn this as I see this applying so many other places. Thank you for your patience.

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Try (untested)
    DoCmd.OpenReport "Season to Date Haul Report", , acViewPreview, "Variety='" & Me.[Cmb_Var] & "'"

  11. #11
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22
    Thank you for all your help; you have no idea.
    Mind if I walk through this with you?
    I have a report "Haul to date by variety". I have a new form called frm_var. The frm_var has a combo box listing all of the varieties. This combo box will drive the criteria of the report of which variety I want to see in the report. In the parameters AFTER UPDATE of the combo box called "cmb_var" the command "DoCmd.OpenReport "Season to Date Haul Report", , acViewPreview, "Variety='" & Me.[Cmb_Var] & "'" Is there supposed to also be a command button to run the report after making the selection in the combo box; this is my confusion I think.

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    No, I don't think so. If you have the DoCmd.OpenReport in the after Update of the combo, I would expect the report to open...unless there is an error .

  13. #13
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22
    Wow it worked!! Thank you, thank you! It's going to printer, possible to change it to print preview; what would the code be?

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Ooops. acViewPreview in wrong argument. Note the change in position in relation to commas. Get familiar with the various arguments of the OpenReport method then the error would become apparent to you.

    DoCmd.OpenReport "report name", acViewPreview, , "Fruit='" & Me.textboxname & "'"
    Last edited by June7; 08-06-2015 at 12:10 PM.
    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.

  15. #15
    ssworthi is offline Novice
    Windows 8 Access 2013
    Join Date
    May 2015
    Posts
    22
    thank you so much! It works perfect now!

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

Similar Threads

  1. Replies: 8
    Last Post: 05-29-2015, 11:52 AM
  2. Replies: 4
    Last Post: 04-30-2014, 09:40 PM
  3. Replies: 1
    Last Post: 05-27-2013, 08:54 AM
  4. Replies: 3
    Last Post: 03-11-2013, 05:11 PM
  5. Replies: 1
    Last Post: 02-02-2009, 05:52 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