Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Sheffield, Yorkshire
    Thanked 0 Times in 0 Posts

    Prevent Change (2003)

    I have a form on a database which is on a shared network. On the form, is a dropdown menu control. How can I prevent others from changing this field apart from two users?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Prevent Change (2003)

    Put code in the On Open or On Load event of the form that checks the username and sets the Locked property of the combo box (I assume that's what you mean by dropdown menu control) accordingly.
    If you have applied user-level security, you can use CurrentUser to get the Access login name of the user, otherwise you can retrieve the network login name using the GetNetUser() function from <post#=446,010>post 446,010</post#>.

    It would look like this:

    Private Sub Form_Load()
    Select Case GetNetUser
    Case "you", "me"
    Me.cboSomething.Locked = False
    Case Else
    Me.cboSomething.Locked = True
    End Select
    End Sub

    Replace GetNetUser with CurrentUser if you have applied user-level security, and replace cboSomething with the name of the combo box.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts