Detect SHIFT key on open?

SimonB1978

Registered User.
Local time
Today, 17:09
Joined
Jan 22, 2009
Messages
161
Hi,

Is there a way to know if the user was pressing the shift key when opening the DB?

I know how to disable it, I just want to know if a smart *ss tried to open it with the shift key....

Thanks,

Simon B.
 
Simon,

That's quite an interesting problem.

I'm assuming that you want to detect this immediately.
Here's one possible method:

You have another Access database (DatabaseB) that acts as a watcher.
It has a table to record user Access from DatabaseA.

When someone opens DatabaseA, with or without the shift-key, they
will either create a new .LDB file or append their name to it.
Your startup form will add their name to the log file in DatabaseB,
if they use the shift-key there will be no entry.

The watcher database just periodically (30-seconds) looks for the
.LDB file.

If it doesn't exist, noone's in DatabaseA.

If it does exist, then ALL user's must be in the log file. Any
missing .LDB entry came in with the shift-key.

It's a lot of work ... do you REALLY need to do this.

Wayne
 
Hi Wayne,

No, I don't NEED this.... It's quite complex for my "curiosity of who use the shift-key". And it would not work since the shift-key is disabled.

I was hoping for something in the like of :

Application.ShiftKeyWasUsedOnOpen = True :)

Thank you anyways!

Simon B.
 
Hi Simon

I'm not sure if this link will help you.

http://www.cpearson.com/excel/KeyTest.aspx

I have just found it and have only done brief tests but it seems to work (not tested with the Shift Bypass Disabled).

The reason I was looking for this is that my app has a lot of startup code that I don't want to add much more to it because I don't want to slow it down but I also want to check that dll's and OCX's have been installed and registered relative for the app to run.
My Intention is to do a key check and if false continue opening the DB but if the app falls over due to unregistered dll or ocx's then the user can re-open the app holding down a specific key which will the launch the code to copy dll's and ocx's from a specific location to the sytem folder and register them.

Hope it helps

Garry
 
Works a treat even with Shift Key Bypass disabled.

Garry
 
Hi Garry,

That does exactly what I wanted!!!

Thanks a lot!!

Simon B.
 
Simply, on open event ask if keypress is keycode shift
 

Users who are viewing this thread

Back
Top Bottom