Veri Silerken Şifre Sorma

26/05/2017, 19:24

serkan1985

Arkadaşlar merhaba kod ile veri silerken şifre sorması için ne eklemem lazım? Yardımcı olursanız sevinirim.


Private Sub Komut27_Click()
On Error GoTo Err_Komut27_Click
Dim c As Integer
c = MsgBox("Seçilen satış silinecek..! Eminmisiniz?", vbOKCancel + vbQuestion, "Bilgi")
If c = vbOK Then
   DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
   DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
 Me.Liste22.Requery
ElseIf c = vbCancel Then
Me.Undo
End If

Exit_Komut27_Click:
   Exit Sub

Err_Komut27_Click:
   MsgBox Err.Description
   Resume Exit_Komut27_Click
   
End Sub
26/05/2017, 19:32

ozanakkaya

26/05/2017, 19:38

serkan1985

Ozan bey çok teşekkürler bu şifreyi "*" şeklinde nası gösterebilirim? Başka birinin görmemesi için?
27/05/2017, 00:25

ozanakkaya

Modül:
Option Compare Database

Private Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, _
ByVal ncode As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Function GetModuleHandle Lib "kernel32" Alias _
"GetModuleHandleA" (ByVal lpModuleName As String) As Long

Private Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" _
(ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, _
ByVal dwThreadId As Long) As Long

Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long

Private Declare Function SendDlgItemMessage Lib "user32" Alias "SendDlgItemMessageA" _
(ByVal hDlg As Long, ByVal nIDDlgItem As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long

Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
(ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long

Private Const EM_SETPASSWORDCHAR = &HCC
Private Const WH_CBT = 5
Private Const HCBT_ACTIVATE = 5
Private Const HC_ACTION = 0

Private hHook As Long

Public Function NewProc(ByVal lngCode As Long, ByVal wParam As Long, _
ByVal lParam As Long) As Long
   Dim RetVal
   Dim strClassName As String, lngBuffer As Long

   If lngCode < HC_ACTION Then
       NewProc = CallNextHookEx(hHook, lngCode, wParam, lParam)
       Exit Function
   End If

   strClassName = String$(256, " ")
   lngBuffer = 255
   
   If lngCode = HCBT_ACTIVATE Then
       RetVal = GetClassName(wParam, strClassName, lngBuffer)
       
       If Left$(strClassName, RetVal) = "#32770" Then
         
           SendDlgItemMessage wParam, &H1324, EM_SETPASSWORDCHAR, Asc("*"), &H0
       End If
   End If

 
   CallNextHookEx hHook, lngCode, wParam, lParam

End Function

Public Function InputBoxDK(Prompt, Optional Title, Optional Default, Optional XPos, _
Optional YPos, Optional HelpFile, Optional Context) As String
   Dim lngModHwnd As Long, lngThreadID As Long
   lngThreadID = GetCurrentThreadId
   lngModHwnd = GetModuleHandle(vbNullString)
   hHook = SetWindowsHookEx(WH_CBT, AddressOf NewProc, lngModHwnd, lngThreadID)
   InputBoxDK = InputBox(Prompt, Title, Default, XPos, YPos, HelpFile, Context)
   UnhookWindowsHookEx hHook
End Function



Form:

Private Sub Komut0_Click()

Dim cevap, sifre As String
sifre = "12345"

cevap = InputBoxDK("Şifrenizi Yazınız.")
If cevap = sifre Then

MsgBox ("şifre doğru")
Else
MsgBox ("şifre yanlış")
End If


End Sub
27/05/2017, 01:44

serkan1985

Çok teşekkürler ozan bey