[font=arial]الأخ علي
ابشر
الكود التالي في وحدة نمطية عامة ( Module )
Declare Function SetTimer Lib "user32" (ByVal hWnd _
As Long, ByVal nIDEvent As Long, ByVal uElapse _
As Long, ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hWnd As Long, ByVal nIDEvent As Long) _
As Long
Declare Function FindWindowEx Lib "user32" _
Alias "FindWindowExA" (ByVal hWndParent As _
Long, ByVal hWndChildAfter As Long, ByVal _
lpClassName As String, ByVal lpWindowName _
As String) As Long
Declare Function Sendmessagebynum _
Lib "user32" Alias "SendMessageA" (ByVal _
hWnd As Long, ByVal wMsg As Long, ByVal _
wParam As Long, ByVal lParam As Long) _
As Long
Const EM_SETPASSWORDCHAR = &HCC
Public str_Title$, TimerId&
Sub TimerProc(ByVal hWnd As Long, ByVal uMsg As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long)
KillTimer 0, TimerId
Dim lng_Hwnd&
lng_Hwnd = FindWindowEx(0, 0, "#32770", _
Trim(str_Title))
lng_Hwnd = FindWindowEx(lng_Hwnd, 0, _
"Edit", vbNullString)
If lng_Hwnd Then
Sendmessagebynum lng_Hwnd, EM_SETPASSWORDCHAR, 42, 0
End If
End Sub
والكود التالي عند فتح النموذج المشار له في الكود الذي وضعته أعلاه
TimerId = SetTimer(0, 0, 1, AddressOf TimerProc)
str_Title = "كلمة مرور الدخول"
str_Prompt = "فضلاً إدخل كلمة المرور"
Answer = InputBox(str_Prompt, str_Title)
If Answer <> 123 Then
DoCmd.CancelEvent
MsgBox " Error passport", 64, "For Conformation"
Else
DoCmd.OpenForm "Fphone"
End If
وغير كلمة المرور 123 بأي كلمة تناسبك