When my form opens I have code that will lock certain users from making edits, additions and deletions to the data on the form.
If get_windows_username() = "KTKISLI" Then
Me.Form.AllowAdditions = False
Me.Form.AllowDeletions = False
Me.Form.AllowEdits = False
Me.Form.DataEntry = False
Else
Me.Form.AllowAdditions = True
Me.Form.AllowDeletions = True
Me.Form.AllowEdits = True
Me.Form.DataEntry = True
End If
This works fine untill I have a text box with a gotfocus function. If the user is KTKISI and she goes to text box with the GotFocus() function behind it, she is not able to make an updates to that text box but when she tabs to the next text textbox she is able to make updates. Any texts boxes she goes to after the textbox with the GotFocus() function she can update. Why is the GotFucus() function turning the allowedits back to true?
Private Sub DateFileReturned_GotFocus()
Me.CurrentDateFileReturned = Me.DateFileReturned
Me.TrackChanges = Me.DateFileReturned
End Sub
If get_windows_username() = "KTKISLI" Then
Me.Form.AllowAdditions = False
Me.Form.AllowDeletions = False
Me.Form.AllowEdits = False
Me.Form.DataEntry = False
Else
Me.Form.AllowAdditions = True
Me.Form.AllowDeletions = True
Me.Form.AllowEdits = True
Me.Form.DataEntry = True
End If
This works fine untill I have a text box with a gotfocus function. If the user is KTKISI and she goes to text box with the GotFocus() function behind it, she is not able to make an updates to that text box but when she tabs to the next text textbox she is able to make updates. Any texts boxes she goes to after the textbox with the GotFocus() function she can update. Why is the GotFucus() function turning the allowedits back to true?
Private Sub DateFileReturned_GotFocus()
Me.CurrentDateFileReturned = Me.DateFileReturned
Me.TrackChanges = Me.DateFileReturned
End Sub