Access JumpStart 2.0 | Blog

A Rapid Development Framework for Microsoft Access

They sound the same, don’t they? But they aren’t!!!

Often you want to control elements visibility on forms.  For example, you might want to hide certain fields or buttons from view when you are adding a record instead of editing it.

In a recent case for my application, I had a continuous form that has a print preview button on it for log entries that had an associated order that can be printed.  Some of the log entries would not have an associated order and so I didn’t want them clicking on the print preview button.

I initially tried to use the Visible property of the command button, however, since this was a continuous form, the Visible property hid or displayed the button on all the continuous form rows because it applies globally.  In order to make the button invisible just on the rows that I wanted, I instead used the Transparent property.  This applies to just a single row and occurs for each row printed on the screen.  This was a handy trick.  I discovered that although the button was transparent, a user could still click it, but I was able to handle that situation by doing nothing when there was no record to print using an If statement in the OnClick event of the button.