disable some buttons

deepbreath

Registered User.
Local time
Today, 18:18
Joined
Apr 18, 2001
Messages
73
i have put some command buttons on my mainform, what i want to do is that when i open mainform directley all should be enabled, but when i come to mainform through another open form, certain buttons should be disabled. help plz
 
Welllll.... You could set up a public variable:
Public strWhichForm As String
Then, each form always sets this variable:
strWhichForm = Me.Name
And your menu checks it (before it updates it, obviously...) to see where control came from:
If strWhichForm = "fSomewhereElse" Then
Me.btnXYZ.Enabled = False
Me.btnXYZ.Visible = False 'maybe?
Else
Me.btnXYZ.Enabled = True
Me.btnXYZ.Visible = True 'maybe?
End If
strWhichForm = Me.Name
 
thanks, but where to put the code
 

Users who are viewing this thread

Back
Top Bottom