Hi All

I have an embedded macro in a Close Form Button. The macro is used to run some VBA code to check that the form has been completed correctly. The macro sets a Temp Var so the the code knows that it was instigated by the Close Button.

SetTempVar IntDataEntryFrmClose, 6
RunCode FormCloseDataEntryFrmCompliance()
RemoveTempVar IntDataEntryFrmClose

This macro has been working fine until I added an additional sub form (with no connection to the macro) to the form then the macro was failing with the message:

"The command or action RemoveTempVar isn't available now" when you click ok it opens the macro failed message box.

The strange thing is that macro only fails with the above if the Navigation Pane is not displayed.

If AccessOptions/Current Database the Tick Box for "Display Navigation Pane" is selected (so the Navigation Pane is displayed) then the all works as designed with no macro failure. If the Tick Box is deselected (so the Navigation Pane is not displayed) the macro fails.

I need to have the Navigation Pane hidden to prevent user access to tables/code etc.

Any help is appreciated, thanks