By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Disabling the <shift> + <enter>

P: n/a

I know that I saw some information concerning the <shift>+<enter>
combination use to bypass launching an Access mdb application and enter
the Access design workspace. Would someone please direct me to some
information on how to disable this function (and how to re-enable it)?
I believe that I saw some article that showed how to incorporate this
into a command button. That would work for me as I have three different
sign-on authorities for my application and I would only display the
command button for the 'admin' authority. Thanks, in advance, for your
help.

Sue
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Take a look here for code to manage the AllowByPassKey property.

http://www.mvps.org/access/general/gen0040.htm

- Jim

On 19 Aug 2004 19:13:36 GMT, Susan Bricker <sb****@att.net> wrote:

I know that I saw some information concerning the <shift>+<enter>
combination use to bypass launching an Access mdb application and enter
the Access design workspace. Would someone please direct me to some
information on how to disable this function (and how to re-enable it)?
I believe that I saw some article that showed how to incorporate this
into a command button. That would work for me as I have three different
sign-on authorities for my application and I would only display the
command button for the 'admin' authority. Thanks, in advance, for your
help.

Sue
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #2

P: n/a
I have just managed to accomplish this very thing.
Paste the following code into a new module:

Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

You then need to create two command buttons, one to disable the shift key,
the other to enable it.

Disable:
Private Sub diable_Click()
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, False
End Sub

Enable:
Private Sub enable_Click()
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, True
End Sub

Hope this helps,

Mark
"Susan Bricker" <sb****@att.net> wrote in message
news:41**********************@news.newsgroups.ws.. .

I know that I saw some information concerning the <shift>+<enter>
combination use to bypass launching an Access mdb application and enter
the Access design workspace. Would someone please direct me to some
information on how to disable this function (and how to re-enable it)?
I believe that I saw some article that showed how to incorporate this
into a command button. That would work for me as I have three different
sign-on authorities for my application and I would only display the
command button for the 'admin' authority. Thanks, in advance, for your
help.

Sue
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #3

P: n/a

Mark,

Great info. Thanks. One question, though? Why did you create
"ChangeProperty" as a function and not as a sub? I see you are passing
it some arguments. But what is the purpose of setting a return code
value? Thanks, again.

Sue

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

P: n/a
To give some of you a laugh, I'll be honest. I'm not a programmer and have
no idea what you are on about. The example I gave was found on the net by
trawling through the access sites. Maybe one of the more experienced on
here could give you the reason why the code is the way it is.

Regards,

Mark
"Susan Bricker" <sb****@att.net> wrote in message
news:41**********************@news.newsgroups.ws.. .

Mark,

Great info. Thanks. One question, though? Why did you create
"ChangeProperty" as a function and not as a sub? I see you are passing
it some arguments. But what is the purpose of setting a return code
value? Thanks, again.

Sue

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #5

P: n/a
When the function succeeds it returns True. When it fails it returns
False. So the calling routine will "know" to do something, depending on
the return value.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Mark R wrote:
To give some of you a laugh, I'll be honest. I'm not a programmer and have
no idea what you are on about. The example I gave was found on the net by
trawling through the access sites. Maybe one of the more experienced on
here could give you the reason why the code is the way it is.

Regards,

Mark
"Susan Bricker" <sb****@att.net> wrote in message
news:41**********************@news.newsgroups.ws.. .
Mark,

Great info. Thanks. One question, though? Why did you create
"ChangeProperty" as a function and not as a sub? I see you are passing
it some arguments. But what is the purpose of setting a return code
value? Thanks, again.

Sue

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Nov 13 '05 #6

P: n/a
Sue

MGFoster,

Thanks for replying. I totally understand about function return codes
(I've been programming for quite a few years). My question was not that
clear ... it should have read ... Why use a function (and not a sub)
with a return code if you are not going to test the return code? I
don't believe that there was a test of the return code from
ChangeProperty. Thanks.

Sue
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #7

P: n/a
As Mark said he's not a programmer and so maybe didn't realise why there was
a return code there.

As you know he could have done something like

if Not ChangeProperty("AllowBypassKey", DB_Boolean, False) then
Msgbox "Allow bypass key may still be enabled"
end if
Having said that the version on the Access Web posted earlier is better as
it uses the DDL setting.
--
Terry Kreft
MVP Microsoft Access
"Sue" <sl*******@yahoo.com> wrote in message
news:41**********************@news.newsgroups.ws.. .

MGFoster,

Thanks for replying. I totally understand about function return codes
(I've been programming for quite a few years). My question was not that
clear ... it should have read ... Why use a function (and not a sub)
with a return code if you are not going to test the return code? I
don't believe that there was a test of the return code from
ChangeProperty. Thanks.

Sue
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.