The Linux Page

Hiding columns in a Datasheet form

I have been looking for a way to hide some columns in a datasheet form.

The main reason to hide columns is to include data that you need whenever the user clicks somewhere, but that data is too technical to be shown. For instance, if you work with QODBC you have the ListID and TxnID to keep around but both look like GUID and thus are much better hidden from an every day user view.

The reason why I'm bringing this up is simple: whenever you have a field in a form that you want to hide, you click on it, go to the Format properties of that control and select Visible: No, I use that to save variables rather than using a global variable in VBA because globals don't stick as well. There are times when I still use a global, but that's rare.

Now, I did the same on the datasheet columns I wanted to hide. But the column is still visible in Form View mode...

I looked around and just could not find a way until I had the idea to right click on the column and see what the menu would give me. That is, I right clicked on the column in Form View. That was the solution. Somehow, MS-Access will save the information along the table and thus next time you open the same form, the columns you hid are still hidden. Of course, that means the end users can go in a unhide these columns, but at least I've done my job.

Microsoft is funny in this way. I think the Visible: No option should work because at least that way end users would not be able to change it. Maybe in a future version.