INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Form Basics

How to have a button appear on form only when other form NOT open by assets
Posted: 27 Sep 04 (Edited 27 Sep 04)

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

    End Sub

Back to Microsoft: Access Forms FAQ Index
Back to Microsoft: Access Forms Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close