Re: AllowBypassKey



I have been having the same problem setting this up. However when I
debug/compile it doesn't like:
Dim db as Database
I get Compile Error - User-defined type not defined.
How do I fix this?

"Douglas J. Steele" wrote:

Within the VB Editor, go to the Debug menu and choose to Compile (the first
option). That should highlight the specific line that's causing problems.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Tom" <Tom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C4866CF7-0D7D-483A-B019-7524DDBD91FE@xxxxxxxxxxxxxxxx
Thanks for the responses. It seems that with limited knowledge I am
struggling to pose the right questions. I named my module "key". I cannot
see
any indication of the line the error is occuring on - I get a message with
the error in my original post.
I tried changing:
Dim db As Database
Dim prop As DAO.Property

and still getting the same error.

Thanks again.



"Douglas J. Steele" wrote:

You've already got a couple of other suggestions that require answers
from
you. I just thought I'd point out that

Dim db As Database
Dim prop As Property

would be safer as

Dim db As Database
Dim prop As DAO.Property


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Tom" <Tom@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:538BDF31-6ACA-4415-A963-15FE6CDD2A00@xxxxxxxxxxxxxxxx
I have tried this, copied the code and followed instructions. I get
error
message:
"Compile Error:
Expected:="

Any further assistance?
Thanks

"Joan Wild" wrote:

Copy your database.

Make sure you are in the main database window. Click the "modules"
tab,
then
select "new." Alternatively, you can open an existing module if you
have
one.

Copy/paste the following function into it. Save the module giving it
some
name other than DisableShiftKeyBypass.

**start**

Function DisableShiftKeyBypass() As Boolean
On Error GoTo errDisableShift

Dim db As Database
Dim prop As Property

Set db = CurrentDb()

On Error Resume Next
db.Properties.Delete "AllowByPassKey"
On Error GoTo errDisableShift

Set prop = db.CreateProperty("AllowByPassKey", dbBoolean, False,
True)
db.Properties.Append prop
DisableShiftKeyBypass = True

exitDisableShift:
Set prop = Nothing
Set db = Nothing
Exit Function

errDisableShift:
MsgBox "Function DisableShiftKeyBypass did not complete
successfully."
DisableShiftKeyBypass = False
Resume exitDisableShift

End Function

***end***

Click on Debug, Compile, and then close the module saving it.

At the database window, hit Ctrl-G which will open the debug window.

Type DisableShiftKeyBypass() and hit enter.

The next time you open the db, the shift will be disabled.

You only need to run the sub once to set the property and then it is
set.
It isn't something you would run repeatedly as it isn't necessary.

You can go back to that copy you made in step 1 (which you'll keep in
a
safe
place) when you want to make changes, or you can use another database
to
set the prop back on this database.

Or you could use Albert's utility to set it on/off. Look for By Pass
Shift
Key Code at
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

--
Joan Wild
Microsoft Access MVP

"Sherry" <Sherry@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F06085E7-48D3-4F19-BD28-A410BCA62D61@xxxxxxxxxxxxxxxx
can any one tell me step by step way how to use this property to
stop
users open the database by pressing shift key, I have tryed different
codes
but i dont know where to put that code and where is the immidiate
window,
so
pls tell me step by step how to do this. thanks









.



Relevant Pages

  • Re: AllowBypassKey
    ... Dim db as Database ... Doug Steele, Microsoft Access MVP ... Dim prop As DAO.Property ...
    (microsoft.public.access.security)
  • Re: Bypass Shift Key Problems...Help Please
    ... Dim ws As Workspace ... Dim db As Database ... Dim prop As Property ... MsgBox "Function DisableShiftKeyBypass did not complete ...
    (microsoft.public.access.security)
  • Re: AllowBypassKey
    ... DisableShiftKeyBypass() in the immediate window and when I hit enter it gave ... Dim db as Database ... Make sure you are in the main database window. ...
    (microsoft.public.access.security)
  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)

Loading