This will ask the user for the same information as you described and only pull the data for the specified time period. If the report is based on a query, in the criteria row of the date field of the query useīetween and I suggest being patient and see if more qualidfied SQL Experts have a different, and more practical, approach.
![access field ordering showhide fields access field ordering showhide fields](https://www.customguide.com/images/lessons/access-2016/access-2016--hide-a-column--05.png)
SQL is really not my area, but you would probably have to dynamically create a QueryDef (Query) Object, and built the SQL Statement only to show those Months that are explicitly included within the Range. I like to think that if I see a code I can figure out what each element is doing, but I'm still a beginner. I wrote code for a query by form so a user would be able to select criteria and an order (4 levels) and it works perfect.
Access field ordering showhide fields how to#
I don't know how to describe my knowledge of VBA exactly.
![access field ordering showhide fields access field ordering showhide fields](https://media.gcflearnfree.org/ctassets/topics/236/table_field_hide_select.png)
Is it possible to hide the fields that sum to 0? So if the months are not within the date range selected, the fields for those months would not be shown. A user of this table will be prompted to select a beginning date and an ending date and the sales for each month are calculated based on the dates given (say if the dates inputted are and, the field for January-June 2006 will sum to 0 for all products and July 2006-July 2007 will have some value). I have a monthly sales query that sums monthly sales by product (each month has its own field from January last year until December of the current year).