General

6.57 Disabilitare/abilitare l'effetto del tasto shift all'avvio (solo amministratori).
  Federico Luciani
Function bypassKeyAdmin(bolVal As Boolean, Optional strMDB As String) As Boolean
 'Autore: sconosciuto
 'Modificato da Federico Luciani
 'Accetta:
 ' bolVal = True: abilita; False: disabilita
 ' strMdb = [Opz.] percorso+nome del database
 'Restituisce: True l'operazione e' stata eseguita correttamente
    
    On Error GoTo ChangePropertyDdl_Err
    Dim wrk As Workspace
    Dim dbs As DAO.Database
    Dim prp As DAO.Property

    Set wrk = DBEngine.Workspaces(0)
    If strMDB = "" Then
         Set dbs = CurrentDb()
    Else
         Set dbs = wrk.OpenDatabase(strMDB)
    End If
    dbs.Properties.Delete "AllowBypassKey"
    Set prp = dbs.CreateProperty("AllowBypassKey", dbBoolean, bolVal, True)
    dbs.Properties.Append prp
    bypassKeyAdmin = True
ChangePropertyDdl_Exit:
    Set prp = Nothing
    Set dbs = Nothing
    Set wrk = Nothing
    Exit Function
ChangePropertyDdl_Err:
    If Err.Number = 3265 Then
        Resume Next
    Else
        MsgBox Err.Number & " - " & Err.Description
    End If
    Resume ChangePropertyDdl_Exit
End Function
Attenzione.
Le proprieta' create con il parametro DDL impostato a true possono essere modificate solo dagli Amministratori. Quindi l'utilizzo di questa funzione in sistemi senza protezione a livello utente, la rende perfettamente identica all'altra presente su questo sito, cioe' modificabile da chiunque.

Per provare la funzione inseritela in un altro mdb e dalla finestra di debug eseguite:
?bypassKeyAdmin(False ,"C:\tuo.mdb") 'per disabilitare
?bypassKeyAdmin(True ,"C:\tuo.mdb") 'per abilitare


Se pensate di avere del materiale freeware interessante e volete pubblicarlo, allora leggete qui.