Neler neler yaptım, yine olmadı...
![Img-grin Img-grin](https://accesstr.net/images/smilies/img-grin.gif)
Formun olayına kodları doğrudan yazınca hiçbir sorun olmuyor. Ben zaten ilk olarak formun olayında yazmıştım bu kodları. Ama fonksiyon olarak yazınca sürekli hata alıyorum. Anlayamadım gitti...
Function Yetki(F As Form)
Dim SonKayit As String
Dim Yetki As String
Dim ctl As Control
SonKayit = DMax("[ID]", "[tblKullaniciLoglari]")
Yetki = DLookup("[txtKullaniciYetkisi]", "[tblKullaniciLoglari]", "[ID]=" & SonKayit)
If Yetki = "Yönetici" Then
Else
F.AllowAdditions = False
F.AllowDeletions = False
F.AllowEdits = False
End If
Function YetkiKontrol(F As Form)
Dim SonKayit As String
Dim Yetkili As String
SonKayit = DMax("[ID]", "[tblKullaniciLoglari]")
Yetkili = DLookup("[txtKullaniciYetkisi]", "[tblKullaniciLoglari]", "[ID]=" & SonKayit)
If Yetkili = "Yönetici" Then
Else
F.AllowAdditions = False
F.AllowDeletions = False
F.AllowEdits = False
End If
End Function