In Access 2016 I have a table with results from a checklist. With a query I select those records where in one of 48 fields the text “NOT OK” is present. The output of the query is shown in a datasheet. 48 columns means a very wide datasheet, so I want to hide all columns where “NOT OK” is not present.
I know queries cannot hide/unhide columns so I probably have to use VBA. I was thinking of looping through each column, check column for “NOT OK” and hide if not found. But how do I check values in a column. Do I need to loop through each record as well?
In my search I found some topics about hiding empty columns, but it refers to reports which does not have the ‘on print’ event. Maybe using a recordset?
Or is there another way to accomplish this?
Thanks.
I know queries cannot hide/unhide columns so I probably have to use VBA. I was thinking of looping through each column, check column for “NOT OK” and hide if not found. But how do I check values in a column. Do I need to loop through each record as well?
In my search I found some topics about hiding empty columns, but it refers to reports which does not have the ‘on print’ event. Maybe using a recordset?
Or is there another way to accomplish this?
Thanks.