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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visible/Enable Fields on Form

Status
Not open for further replies.

daniellee4874

Programmer
Feb 27, 2007
11
US
I was wondering if it was possible to create a module/tool that will let me "show"/"enable" certain fields on a firm. By "show" I mean that the user can edit the field. By enable I mean that the field will be displayed on the form but will not be editable.

For instance if I had fields:
Name
Phone
Fax
Address
City
State
Zip
Email

I would have 3 users set up:
User 1: Can view all fields
User 2: Can view only Name and Phone

I know I can set up group settings but I was wondering if it possible to create a tool that will let a manager/administrator simply click on check boxes which fields that users are able to view.
User 3: Can view only Name and Email
 
Use textboxes for your name,etc. If you do not want some changing it then set the ReadOnly property to true. If ok to change then set the ReadOnly property to false.
 
Danielle, chrissie was right, you will have to come up with something yourself, but it isnt that hard.

Btw, you have your "show"/"enable" definitions backwards:

Show, but no edit = enabled = false, visible= true
enabled = enabled = true, visible = true

You can create a sub that looks something like:

Code:
    Public Sub FlipEnabled(ByVal oControl As TextBox)
        oControl.Enabled = Not oControl.Enabled
    End Sub
    Public Sub FlipControlsEnabledStatus()
        FlipEnabled(txtName)
        FlipEnabled(txtPhone)
    End Sub

    Private Sub chkFlipEnabled_CheckChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkFlipEnabled.CheckedChanged
        FlipControlsEnabledStatus()
    End Sub

You may want to change that to pass thu the enabled status that you want.

-The answer to your problem may not be the answer to your question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top