M
madisonlynn
I have a locked field that captures the user name automatically. Now User
name is a field among other fields in a record. When I use my form to
find a record it populates the data into the fields. What i'm trying to
do is capture the User name that just populated into the locked field and
use it in code for my sub routines. One problem though, when I type in
Me.UserID I get null, but its not null. Below is my code. Can someone
tell me where I went wrong?
Cancel = True
MsgBox "Required field." & vbCrLf & "Scan barcode!",
vbExclamation
Me.txtDocID.SetFocus
Exit Sub
Else
If Len(Me.[DocID].Value) <> 8 Then
MsgBox "The Document ID should consists of 8 characters and
numbers."
'Cancel = True
'Me.Undo
'GoTo Exit_Here
End If
If blnAdd Then
With Me.RecordsetClone
.FindFirst "DocID = """ & Me.[DocID] & """"
If Not .NoMatch Then
Dim Msg As String
Beep
Msg = ""
Msg = Msg & "This Record already exists! Let me find
it for you."
MsgBox (Msg)
Me.Undo
blnAdd = False
Me.txtDocID.Locked = True
Me.Bookmark = .Bookmark
'Me.cmdAdd.SetFocus
If Not IsNull(txtFileNetDocID) Then
Me.cmdDelete.Enabled = False
Me.cmdSave.Enabled = False
Me.AllowDeletions = False
Me.AllowEdits = False
MsgBox "This Record is already in FileNet!
Changes to any record will need to be made in FileNet."
GoTo Exit_Here
Else
'If IsNull(txtFileNetDocID) Then
If Me.UserID = GetCurrentUserName() Then
Me.AllowDeletions = True
Me.AllowEdits = True
Me.cmdDelete.Enabled = True
Me.cmdSave.Enabled = True
End If
'End If
GoTo Exit_Here
End If
GoTo Exit_Here
End If
End With
End If
GoTo Exit_Here
name is a field among other fields in a record. When I use my form to
find a record it populates the data into the fields. What i'm trying to
do is capture the User name that just populated into the locked field and
use it in code for my sub routines. One problem though, when I type in
Me.UserID I get null, but its not null. Below is my code. Can someone
tell me where I went wrong?
Cancel = True
MsgBox "Required field." & vbCrLf & "Scan barcode!",
vbExclamation
Me.txtDocID.SetFocus
Exit Sub
Else
If Len(Me.[DocID].Value) <> 8 Then
MsgBox "The Document ID should consists of 8 characters and
numbers."
'Cancel = True
'Me.Undo
'GoTo Exit_Here
End If
If blnAdd Then
With Me.RecordsetClone
.FindFirst "DocID = """ & Me.[DocID] & """"
If Not .NoMatch Then
Dim Msg As String
Beep
Msg = ""
Msg = Msg & "This Record already exists! Let me find
it for you."
MsgBox (Msg)
Me.Undo
blnAdd = False
Me.txtDocID.Locked = True
Me.Bookmark = .Bookmark
'Me.cmdAdd.SetFocus
If Not IsNull(txtFileNetDocID) Then
Me.cmdDelete.Enabled = False
Me.cmdSave.Enabled = False
Me.AllowDeletions = False
Me.AllowEdits = False
MsgBox "This Record is already in FileNet!
Changes to any record will need to be made in FileNet."
GoTo Exit_Here
Else
'If IsNull(txtFileNetDocID) Then
If Me.UserID = GetCurrentUserName() Then
Me.AllowDeletions = True
Me.AllowEdits = True
Me.cmdDelete.Enabled = True
Me.cmdSave.Enabled = True
End If
'End If
GoTo Exit_Here
End If
GoTo Exit_Here
End If
End With
End If
GoTo Exit_Here