Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hiding command buttons

Status
Not open for further replies.

biggvito

Technical User
Oct 22, 2001
14
0
0
GB
i am doing a simple program in vb6 where users have access to certain forms depending on the password they enter. can anyone please tell me how to hide command buttons or make command buttons invisible. or tell me a simpler way of stoping access to forms depending on level of password.

help will be greatly appreciated.thx
 
THX MATE .FAST RESPONSE.BUT HOW DO I GET IT TO HIDE COMMAND BUTTONS IN OTHER FORMS.FOR INSTANCE ONE CALLED "ADD" IN FORM CALLED "CUSTOMER"
 
Easiest.
Define a Public boolean in a standard module to indicate that buttuns should be hidden. Access the boolean in the Form_Load event of each form.
' Declarations of MyCommon.Bas
Public gblnPasOk As Boolean
' My Form
Private Form_load()
cmdButton.Visible = blnPassOK
End Sub Compare Code (Text)
Generate Sort in VB or VBScript
 
There is an alternative to JohnYingling's method:

from the form you input the password on you can hide the buttons you want
ex:
Private Sub cmdOK_Click()
Form2.cmdAdd.visible=false
end sub

cmdOK is your button for checking the password and form2 is the form with the button you want to hide: cmdAdd is the button you are hiding

just a little example to help you on your way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top