mardi 5 avril 2016

Form ON CURRENT Event - Access 2013

Private Sub Form_Current()

   If Nz(Me!CompName, "") = "" Then
      Me!CompName.Locked = False

   Else
    If (txtName = "Maxie") Then
        Me!CompName.Locked = False
        Else
        Me!CompName.Locked = True
    End If
End if
End Sub

CompName is a Textbox where I Enter Company Name and once there is an input the user cannot edit it Unless the user from "txtName is Maxie" txtName is a unbound textbox which acquire the Username from the Login Form.

The Problem is even the txtName Contain "Maxie" the CompName textbox is still locked.

Please help me solve this.

By the way I use this code under ON CURRENT Event.

Aucun commentaire:

Enregistrer un commentaire