473,464 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Open DB Window with function key

In our database, we have some problem users that think they need to
get at the tables themselves rather than use the forms. So I want to
keep them from getting to them at all. I've set the DB Window not to
open, but it seems they know the "hold down shift key" trick. I've
been doing a little digging, and found a way to do this. Set a
KeyDown event for my main form, have it open a form with an unbound
text box to use as a password, and then show the database window.

What I can't get working is the keydown event. Here's the code I set
for the KeyDown event on my main form

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF11 Then
KeyCode = 0
DoCmd.OpenForm "frmDBPassword", acNormal
End If
End Sub

But when I select the form and hit F11, it just switches focus to the
DBWindow, as the default behaviour. I thought the 'KeyCode = 0' line
was supposed to take care of that, but it doesn't seem to be working.
I'd be eternally grateful if someone could toss me a clue.

TIA, madd
Nov 13 '05 #1
3 2777
See help on AllowBypassKey

Under Tools | Startup, you can disable "Special Keys".

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"maddman" <ma********@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
In our database, we have some problem users that think they need to
get at the tables themselves rather than use the forms. So I want to
keep them from getting to them at all. I've set the DB Window not to
open, but it seems they know the "hold down shift key" trick. I've
been doing a little digging, and found a way to do this. Set a
KeyDown event for my main form, have it open a form with an unbound
text box to use as a password, and then show the database window.

What I can't get working is the keydown event. Here's the code I set
for the KeyDown event on my main form

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF11 Then
KeyCode = 0
DoCmd.OpenForm "frmDBPassword", acNormal
End If
End Sub

But when I select the form and hit F11, it just switches focus to the
DBWindow, as the default behaviour. I thought the 'KeyCode = 0' line
was supposed to take care of that, but it doesn't seem to be working.
I'd be eternally grateful if someone could toss me a clue.

TIA, madd

Nov 13 '05 #2
> "maddman" <ma********@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
In our database, we have some problem users that think they need to
get at the tables themselves rather than use the forms. So I want to
keep them from getting to them at all. I've set the DB Window not to
open, but it seems they know the "hold down shift key" trick. I've
been doing a little digging, and found a way to do this. Set a
KeyDown event for my main form, have it open a form with an unbound
text box to use as a password, and then show the database window.

What I can't get working is the keydown event. Here's the code I set
for the KeyDown event on my main form

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF11 Then
KeyCode = 0
DoCmd.OpenForm "frmDBPassword", acNormal
End If
End Sub

But when I select the form and hit F11, it just switches focus to the
DBWindow, as the default behaviour. I thought the 'KeyCode = 0' line
was supposed to take care of that, but it doesn't seem to be working.
I'd be eternally grateful if someone could toss me a clue.

TIA, madd

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:<41**********************@per-qv1-newsreader-01.iinet.net.au>... See help on AllowBypassKey

Under Tools | Startup, you can disable "Special Keys".

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


That's not what my problem is. I can get the database window to not
open even with the shift key. What I need is a code to prompt for a
password when I press F11 (or some other function key). Everything
works except triggering off the above code.
Nov 13 '05 #3
If this is application wide, create a macro named AutoKeys.
In the MacroName column to specify the keystroke, e.g.:
{F11}
In the Action column, use RunCode to call the procedure you wish to call, or
use OpenForm to open a small unbound form where the user must enter your
"password".

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"maddman" <ma********@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
"maddman" <ma********@yahoo.com> wrote in message
news:be**************************@posting.google.c om...
> In our database, we have some problem users that think they need to
> get at the tables themselves rather than use the forms. So I want to
> keep them from getting to them at all. I've set the DB Window not to
> open, but it seems they know the "hold down shift key" trick. I've
> been doing a little digging, and found a way to do this. Set a
> KeyDown event for my main form, have it open a form with an unbound
> text box to use as a password, and then show the database window.
>
> What I can't get working is the keydown event. Here's the code I set
> for the KeyDown event on my main form
>
> Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
> If KeyCode = vbKeyF11 Then
> KeyCode = 0
> DoCmd.OpenForm "frmDBPassword", acNormal
> End If
> End Sub
>
> But when I select the form and hit F11, it just switches focus to the
> DBWindow, as the default behaviour. I thought the 'KeyCode = 0' line
> was supposed to take care of that, but it doesn't seem to be working.
> I'd be eternally grateful if someone could toss me a clue.
>
> TIA, madd
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message

news:<41**********************@per-qv1-newsreader-01.iinet.net.au>... See help on AllowBypassKey

Under Tools | Startup, you can disable "Special Keys".


That's not what my problem is. I can get the database window to not
open even with the shift key. What I need is a code to prompt for a
password when I press F11 (or some other function key). Everything
works except triggering off the above code.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
2
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
1
by: ian.michel | last post by:
I have a parent window that pushes a new window object onto an Array with the following code : OpenChild() { //totalNumWindowsCreated is global totalNumWindowsCreated =...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
13
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related...
6
by: Jack | last post by:
I have a main webpage that has a list of records, each with a link to a window.open function call. As an example, a page that opens is editrecord.aspx?RecordID=34, and another is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.