bypass shift key

S

sandrao

Is there a simple way to disable the use of the shift key so that individuals
cannot get access to tables and other fuctions in a database. I have my
database opening to a form but I don't want anyone to have access to the
information in the background. Also, I myself would still want to have acces
to these table, etc.

any Ideas
 
K

Keith Wilby

You can use Albert Kallal's utility (of course your users could also use it
to re-enable the shiftkey, if they know about it).

You can minimise those chances by using code to detect that the admins group
is being used:

Sub SetBypassProperty()

'Tries to set the AllowBypassKey property and creates it if it fails to find
it.
'Calls libChangePropertyDdl

Const DB_Boolean As Long = 1
ChangePropertyDdl "AllowBypassKey", DB_Boolean, False
End Sub

Function ChangePropertyDdl(stPropName As String, PropType As
DAO.DataTypeEnum, vPropVal As Variant) As Boolean

' Uses the DDL argument to create a property that only Admins can change.
' Current CreateProperty listing in Access help is flawed in that
' anyone who can open the db can reset properties, such as AllowBypassKey

On Error GoTo ChangePropertyDdl_Err

Dim db As DAO.Database
Dim prp As DAO.Property

Const conPropNotFoundError = 3270

Set db = CurrentDb
' Assuming the current property was created without
' using the DDL argument. Delete it so we can
' recreate it properly
db.Properties.Delete stPropName
Set prp = db.CreateProperty(stPropName, PropType, vPropVal, True)
db.Properties.Append prp

' If we made it this far, it worked!
ChangePropertyDdl = True

ChangePropertyDdl_Exit:
Set prp = Nothing
Set db = Nothing
Exit Function

ChangePropertyDdl_Err:
If Err.Number = conPropNotFoundError Then
' We can ignore when the prop does not exist
Resume Next
End If
Resume ChangePropertyDdl_Exit
End Function

Keith.
www.keithwilby.com
 
S

sandrao

I downloaded the utility from Albert Kallal and it works fine. Just one
other question, If I disable the shiftkey in a data base in my computer and
then zip it and pass it on to the individual who will be using it and it is
placed in his computer will the disable effect still work?
 
J

Joan Wild

The OP never mentioned whether the mdb was secured, so I assumed it wasn't - it won't make a difference in an unsecured mdb.
 
K

Keith Wilby

The OP never mentioned whether the mdb was secured, so I assumed it wasn't -
it won't make a difference in an unsecured mdb.

Good point Joan. I made a false assumption.

Keith.
 
J

Joan Wild

Keith Wilby said:
The OP never mentioned whether the mdb was secured, so I assumed it wasn't -
it won't make a difference in an unsecured mdb.

Good point Joan. I made a false assumption.

Well I may have too, who knows. But Albert's utility covers a secure mdb as well.
 
S

Sandy

I am not that great with VB etc. Can you give me more as to where do I put
this code and when do I call it. Does it recogines the Admin automatically
or do I need to hard code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top