Home Forums Microsoft Access Microsoft Access Update Field to current logged in user ID with new record command button RE: Update Field to current logged in user ID with new record command button

  • I put the line of code in but it isn't updating the field and seems to have prevented record navigation command buttons.

    Did I place the line you recommended in the correct position?

    '------------------------------------------------------------

    ' cmdNewRecord_Click

    '

    '------------------------------------------------------------

    Private Sub cmdNewRecord_Click()

    On Error GoTo cmdNewRecord_Click_Err

    On Error Resume Next

    DoCmd.GoToRecord , "", acNewRec

    If (MacroError <> 0) Then

    Beep

    MsgBox MacroError.Description, vbOKOnly, ""

    End If

    Me.txtUserID = Environ("UserID")

    cmdNewRecord_Click_Exit:

    Exit Sub

    cmdNewRecord_Click_Err:

    MsgBox Error$

    Resume cmdNewRecord_Click_Exit

    End Sub