There is nothing wrong with the macro converted to code.
This is the macro
This is the converted code
Code:
'------------------------------------------------------------
' mcrRestore
'------------------------------------------------------------
Function mcrRestore()
On Error GoTo mcrRestore_Err
Call fAccessWindow(3)
Reopen
mcrRestore_Exit:
Exit Function
mcrRestore_Err:
MsgBox Error$
Resume mcrRestore_Exit
End Function
The macro first executes the VBA function "fAccessWindow()" (what the macro command 'RunCode' does).
Then there is the 'RunCode' command to execute the function 'Reopen'.
BUT, nowhere in the code is a function (or Sub) named 'Reopen'. This was one of the problems with macros.... there was no error handling! Since there is no function/sub 'RunCode', the macro just skipped over the error. (or so it appears to me)
So now that the macro is converted to code, there is an error because the "Reopen' code is missing.
Don't know what the 'RunCode' code was supposed to do, so delete the line.
When converting macros to code, you have to first
understand WHAT the macro was trying to do, then edit the converted code to clean up the converted code. (as in Post #14 - the "FormHeading" code)
BTW, the function "fAccessWindow()" in your code module "Common" appears to be taken from
http://access.mvps.org/access/api/api0019.htm written by Dev Ashish. But the copyright notice was
removed.