rubbernilly
Programmer
Hello, all. It's been a while since I darkened these corners, but I trust you've kept the place up in my absence. I am digging out some code from an old .mdb file and attempting to update it and purpose it in a new 365 ACCDB. This sort of a thing had worked in the mdb, but doesn't in the accdb, and I'm wondering if there is a known work around?
I'm trying to leave an easter egg in a form using a key sequence. If the user enters the passcode in sequence (caught the KeyDown event), then the easter egg is unlocked. The only thing is, the keys CTRL, SHIFT, and ALT must all be held down while they do it. In the mdb file, I could do this:
[pre]
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim intShiftDown As Integer, intAltDown As Integer, intCtrlDown As Integer
'Use bit masks to determine which key was pressed.
intShiftDown = (Shift And acShiftMask) > 0
intAltDown = (Shift And acAltMask) > 0
intCtrlDown = (Shift And acCtrlMask) > 0
'do other stuff with the value (like compare it to a hash)
'for demonstration/MRC purposes, I'll just debug.print
If intShiftDown And intAltDown And intCtrlDown Then Debug.Print KeyCode
End Sub
[/pre]
That would work (in the MDB) to give differentiated values for keys pressed. In the ACCDB, however, everything flattens to KeyCode 16, and I can't detect what was pushed along with CTRL, SHIFT, and ALT.
Ideas?
I'm trying to leave an easter egg in a form using a key sequence. If the user enters the passcode in sequence (caught the KeyDown event), then the easter egg is unlocked. The only thing is, the keys CTRL, SHIFT, and ALT must all be held down while they do it. In the mdb file, I could do this:
[pre]
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Dim intShiftDown As Integer, intAltDown As Integer, intCtrlDown As Integer
'Use bit masks to determine which key was pressed.
intShiftDown = (Shift And acShiftMask) > 0
intAltDown = (Shift And acAltMask) > 0
intCtrlDown = (Shift And acCtrlMask) > 0
'do other stuff with the value (like compare it to a hash)
'for demonstration/MRC purposes, I'll just debug.print
If intShiftDown And intAltDown And intCtrlDown Then Debug.Print KeyCode
End Sub
[/pre]
That would work (in the MDB) to give differentiated values for keys pressed. In the ACCDB, however, everything flattens to KeyCode 16, and I can't detect what was pushed along with CTRL, SHIFT, and ALT.
Ideas?