Keypress + DblClick to open form

supmktg

Registered User.
Local time
Today, 10:19
Joined
Mar 25, 2002
Messages
360
Hi All,

I have an invisible command button on a form that opens another form that I don't want users to know about under normal circumstances. I've set the command button's on DblClick to open the form.

I'd really like to change it to a Keypress and DblClick combination to further hide it's existance. Can anyone help me add the keypress?

Thanks,

Supmktg
 
Why not just password protect the button?

IMO
 
If I wanted something like this I'd use the custom GetUserName() function (serach here to find it) to determine the user ID and therefore determine if they have access and make the button visible or not depending on the outcome.
 
Thanks for the replies.

I've come up with a solution by combining several ideas from posts on this site. This community is outstanding, Thanks! I'm posting my solution so others may make use of it.

I'm not trying to password protect certain users, I'm trying to keep out all users. There is a table that should never need to be edited, however, in order to cover all the possibilities I have included a form that does edit that table. In the event that's neccesary I can have the user open the form with a series of keystrokes, then close the form and forget that it was ever there.

Here's the code which I put on the keypress event of a transparent command button:

Dim i As Integer

Private Sub CmdClearTrades_KeyPress(KeyAscii As Integer)
i = i + KeyAscii
If i = 643 Then
DoCmd.OpenForm "frmTradeList"
End If

If i > 643 Then
i = 0
End If
End Sub

If the command button is clicked, and then a series of keys are pressed of which the total ascii value is 643 (A=97,E=101,etc) then the form opens. When you press another key after it opens it resets the counter to 0 so it will work again.

P.S. This could also be used for Easter Eggs which is where I got the idea to do it in the first place.
 

Users who are viewing this thread

Back
Top Bottom