LarryE
Active member
- Local time
- Today, 06:25
- Joined
- Aug 18, 2021
- Messages
- 847
Yeah, I learned something. I never use a crosstab anyway in a form. When the number of columns change, it changes the way the crosstab looks, and you need to manually change the column widths. I much prefer to use totals queries based upon normal form criteria. It's much cleaner and you can use continuous subforms to display the data anyway which automatically adjust to accommodate data. Just my opinion. You can use DSums to sum totals as needed without messy code to filter a crosstab. Again, just my own opinion.I wouldn't create multiple tables for items. If you want to group certain items together, add a Category field (with a small lookup table). You can then filter any report or form by Item Category.
Also, someone stated "ACCESS will not filter a crosstab query based upon criteria in a form." which is false. You must add parameter data types in the query. Once you do this, the query will work as expected. The SQL view of a crosstab will look something like:
Code:PARAMETERS [Forms]![frmDisplayQuery]![combx] Text ( 255 ); TRANSFORM Sum(SuppyQuantity.Quantity) AS SumOfQuantity SELECT Classroom.TeacherName, Classroom.ClassroomName, Sum(SuppyQuantity.Quantity) AS [Total Of Quantity] ...