Switchboard used as standalone then error --Basic runtime error, object variable not set

My form name Issue

i have created switchboard with button with micro below

Sub Issue
const sNewDocumentName=“Issue”
oNewFormDocument=ThisDatabaseDocument.FormDocuments.getbyname(sNewDocumentName).open
End Sub

its work ok but when this switchboard used as standalone then error --Basic runtime error, object variable not set

how to overcome this

When you move to standalone forms you have to play by their rules. Macro code does not always work as it did within Base. Not using switchboard or standalone forms, a brief reading showed how to overcome your problem. When using standalone forms the open you are using doesn’t know where the document is located - you are outside of Base so to speak. From this post (click here) the normal opening of another form is with a specific setup of a push button. The post does mention another way - through URL.

I believe your wanting to open another form using a button doesn’t require any code. From the mentioned post:

Place a button to open the form somewhere, modify the Action on General TAB to open document/web page and select the document to open by clicking on the three little buttons next to URL.

thanks for simple way to solution…