disable shift key if user level is already set up?

G

Guest

I know you can disable the shift key with the utility before user level
security is set up, but I haven't found anything in here regarding disabling
the shift key if security is already in place. Is there a way to do that, or
do I need undo the security, turn back on the Admin to the admin group and
delete everyone out but admin and user??
 
J

Joan Wild

Shanin said:
I know you can disable the shift key with the utility before user
level security is set up, but I haven't found anything in here
regarding disabling the shift key if security is already in place.
Is there a way to do that, or do I need undo the security, turn back
on the Admin to the admin group and delete everyone out but admin and
user??

You can disable the shiftkey after securing the database. In fact it's
preferred, since you can set it such that only a member of the Admins Group
can set it back. See
See
http://www.mvps.org/access/modules/mdl0011.htm
and
http://www.mvps.org/access/general/gen0040.htm
 
J

Joan Wild

Shanin said:
Where exactly am I to place that code? Do I just create a Module.

Yes, you put it in a module. Don't give the module the same name as the
Function.

You need to only run it once, afterwhich the shiftkey will be disabled.
Just save the module, and run it from the immediate window.
 
G

Guest

I've only worked with the immediate window a couple of times and that has
been a while back to check on a code that was running. Could you help
refresh my memory. I saved the code in a module and named the module Shift.
How do you call the function??

Thanks
 
J

Joan Wild

Shanin said:
I've only worked with the immediate window a couple of times and that
has been a while back to check on a code that was running. Could you
help refresh my memory. I saved the code in a module and named the
module Shift. How do you call the function??

Ctrl-G
ChangeProperty "AllowBypassKey", dbBoolean, True
 
G

Guest

I'm having the worst luck with this, or just lack of knowledge in working
with it more than likely. I keep getting a "user defined type not defined",
on the first function of that code.

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

I copied that straight from the link you had posted, am I supposed to change
something. I checked the help but it wasn't much help.
 
J

Joan Wild

Shanin said:
I'm having the worst luck with this, or just lack of knowledge in
working with it more than likely. I keep getting a "user defined
type not defined", on the first function of that code.

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

Open the module and go to Tools, References. You need to set a reference to
Microsoft DAO 3.6 Object Library

Also to run it you would use

ChangePropertyDdl "AllowBypassKey", dbBoolean, True
 
G

Guest

Thanks for putting up with all the questions...you've been a big help. I
actually figured the reference thing out before I got this e-mail...woo hoo,
but I hadn't gotten to putting the Ddl on the end there. I ran that from the
Immediate Window, and it didn't show any errors, I closed out, closed the
program and opened it back up holding the shift key, and it still bypassed my
startup!! I think the Access gods are against me on getting this one final
thing done to this database. What else could be wrong. I tried it on a
different login too, one that is not Administrative, and it allowed the
bypass to work also.
 
J

Joan Wild

Shanin said:
Thanks for putting up with all the questions...you've been a big
help. I actually figured the reference thing out before I got this
e-mail...woo hoo, but I hadn't gotten to putting the Ddl on the end
there. I ran that from the Immediate Window, and it didn't show any
errors, I closed out, closed the program and opened it back up
holding the shift key, and it still bypassed my startup!! I think
the Access gods are against me on getting this one final thing done
to this database. What else could be wrong. I tried it on a
different login too, one that is not Administrative, and it allowed
the bypass to work also.

Which code are you using? There is a sample in the security FAQ
http://support.microsoft.com/?id=207793
 
G

Guest

This is the code I was using, which was from the link in your original
response. The one that addresses the setting the 4th to true but maybe that
only addresses setting the Ddl to true.

'This code was originally written by Michael Kaplan.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Michael Kaplan
'
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
 
J

Joan Wild

Shanin said:
This is the code I was using, which was from the link in your original
response. The one that addresses the setting the 4th to true but
maybe that only addresses setting the Ddl to true.

I don't see anything wrong with it. I have used it many times without a
problem.

Try opening the module and compiling the code to see if it catches any
errors. (debug. compile)
 
G

Guest

I did that before I ran it and it didn't catch anything, only that first time
before the reference fix. I don't need to do anything special after typing

ChangePropertyDdl "AllowBypassKey", dbBoolean, True

I hit enter and it appear to run it, and I close out and re login, but it
still allows teh shift key to work. Maybe I should try a different code to
see if that will work.

My database is split, and I have the user level security set on both ends,
but that wouldn't interfere with this would it?
 
D

Douglas J. Steele

You need to set the AllowBypassKey parameter to False. When it's set to
True, you're enabling it.
 
G

Guest

This just doesn't want to work for me. I put false in instead of true, hit
enter, closed out, opened it back up, held the shift key, and it still
bypassed everything. There is probably something very simple here that I'm
missing, but it's driving me crazy.
 
G

Guest

This just doesn't want to work for me. I put false in instead of true, hit
enter, closed out, opened it back up, held the shift key, and it still
bypassed everything. There is probably something very simple here that I'm
missing, but it's driving me crazy.
 
G

Guest

The new code wouldn't work for me, so I tried the old code that is from the
same article and it worked!!?? I still haven't figured out why the DDL code
wouldn't work.
 
G

Guest

I used the old code instead of the new DDL code and ran it, and it worked, go
figure. I still do not know why the DDL code would not work correctly
 

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