Can you show the entire code you have for the form (CO_pakiranje_SD14)? You should have all the building pieces now, you have to decide how you want to control the flow. If you want to disable the two controls after a valid Pin is entered you do it in the AfterUpdate event of the PIN textbox.
Code:
Private Sub potpis_operater_AfterUpdate()
Dim Username As String
Dim strSQL As String
Dim strMsg As String
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim password_check As Integer
Username = Form_CO_pakiranje_SD14.operater_p
Set dbs = CurrentDb()
strSQL = "SELECT password FROM Evidencija_radnika WHERE ime_prezime = '" & Username & "';"
Set rst = dbs.OpenRecordset(strSQL)
password_check = rst![Password]
rst.Close
If CInt(Form_CO_pakiranje_SD14!potpis_operater) <> password_check Then
strMsg = Username & ", niste unijeli tocan PIN!"
MsgBox strMsg
Form_CO_pakiranje_SD14!potpis_operater = Null 'Vlad you want to make the control Null not empty string ""
Me.operater_p.Enabled =True
Me.potpis_operater.Enabled=True
Else
'Form_CO_pakiranje_SD14!potpis_operater = password_check 'Vlad don't need this as they are already equal otherwise you won't get here
strMsg = Username & ", uspjesno potvrden PIN!"
MsgBox strMsg
Me.operater_p.Enabled =False
Me.potpis_operater.Enabled=False
End If
Set rst = Nothing
Set dbs = Nothing
End Sub
Did you put the previous code in the Current event of the form?
Cheers,
Vlad