Secure Access With Vba Set Properties Final
Secure Access With Vba Set Properties Final
Option Explicit
'''''''''''''''''''''''''''''''
''''''''insert new module and put the below three codes
1(Setproperties)2(EnableSetProperty)3((DisableSetProperty))'''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''
Public Function DisableSetProperty()
On Error GoTo ThisError
DoCmd.ShowToolbar "Ribbon", acToolbarNo
SetProperties "StartUpShowDBWindow", dbBoolean, False 'Display Database window
SetProperties "StartUpShowStatusBar", dbBoolean, False
SetProperties "AllowFullMenus", dbBoolean, False 'Access Full Menus.
SetProperties "AllowSpecialKeys", dbBoolean, False 'F11,ALT F11, etc.
SetProperties "AllowBypassKey", dbBoolean, False 'Shift Key Override on loading
SetProperties "AllowShortcutMenus", dbBoolean, False 'Access ShortcutMenus. May be
too severe.
SetProperties "AllowToolbarChanges", dbBoolean, False 'Prevent Changes.
SetProperties "AllowBreakIntoCode", dbBoolean, False 'Code access.
DoCmd.ShowToolbar "ribbon", acToolbarNo
DoCmd.NavigateTo ("acnavigationcategoryobjecttype")
ThisError:
MsgBox Err.Description
Exit Function
End Function
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
نیچے واال کوڈ کوON LOAD FORM میں استعمال کرنا ہے۔
DoCmd.ShowToolbar "ribbon", acToolbarNo
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''
Private Sub Command11_Click()
Call EnableSetProperty
MsgBox "All properties are enabled successfully"
DoCmd.Close acForm, Me.Name
End Sub
''''''''''''''''''
Private Sub Command12_Click()
Call DisableSetProperty
MsgBox "All properties are disabled successfully"
DoCmd.Close acForm, Me.Name
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''
Private Sub txtUserName_DblClick(Cancel As Integer)
Dim strinput As String
strinput = InputBox("please enter the password", "enter Password")
If strinput = "Rafiq786" Then
DoCmd.OpenForm "Set_property"
Else
MsgBox "Invalid Password", vbInformation, "Invalid Password"
End If
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub btnLogin_Click()
Dim rs As Recordset
If rs.NoMatch Then
Me.lblWrongUser.Visible = True
Me.txtUserName.SetFocus
Exit Sub
End If
Me.lblWrongUser.Visible = False