This will open a form and not display the close button ( or any other button). If a particular form is open in this case "TheOtherForm" then the button on "ThisForm" will be displayed. You can use this to run reports or for admin function ( if the "TheOtherForm" is the menu then user will not see the button.
The code below goes into the "On Open" properties [Event Procedure].on the form you want to show/hide the button.
Private Sub Form_Open(Cancel As Integer)
If IsLoaded("TheOtherForm") Then
' If the TheOtherForm is open
' the form is opened
' show form's Close/Other button.
CmdCloseForm.Visible = True
Else
' This form was opened as an application
' "Thisform" so hide the button
CmdCloseForm.Visible = False
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.