Option Compare Database Option Explicit Dim Kancel As Boolean Private Sub Form_AfterUpdate() If Me.OpenArgs & "" <> "" Then lngNewUSerID = Me.tb_UserKey If Format$(Me.tb_FirstName) = "" Or Format$(Me.tb_LastName) = "" Then MsgBox "Popuni Podatke" Kancel = True Me.tb_LastName.SetFocus GoTo Kraj End If DoCmd.Close acForm, Me.Name End If Kraj: End Sub Private Sub Form_Load() If Me.OpenArgs & "" <> "" Then 'Open args was sent to the form. Me.tb_FirstName = Me.OpenArgs Me.tb_LastName.SetFocus End If End Sub Private Sub Form_Unload(Cancel As Integer) Cancel = Kancel Kancel = False End Sub