Function Otvori_1(ID As Integer, Optional QR As String, Optional Filter As String) As Boolean Dim Db As Database Dim Rs As Recordset Dim Rs2 As Recordset Dim Frm As Form Dim Uslov As Integer Dim ImeForme As String Dim Tip As Integer Dim Prava As Integer Dim PravaA As Integer Set Db = CurrentDb() If ID < 1 Then: GoTo Kraj Set Rs = Db.OpenRecordset("SELECT * FROM tblOperatori WHERE KorisnikID=" _ & M_Oper.OperID) ImeForme = "frmPristup" Tip = Rs!Sifra Prava = Rs!PravaPristupa PravaA = Rs!PravaAdm If Prava = 3 Then MsgBox "Kao gost" & vbCr & "nemate pravo koristiti ovu formu", vbOKOnly, "Upozorenje!" GoTo Kraj Else Select Case Tip Case 1 'Otvori formu Forms!frmPristup.Form.RecordSource = ("SELECT * FROM tblOperatori WHERE KorisnikID=" _ & M_Oper.OperID) DoCmd.OpenForm ImeForme, , , , , acIcon Set Frm = Forms(ImeForme) Frm.SetFocus DoCmd.Restore .........