suppress pageup and pagedown using keycodes

  • Thread starter Thread starter jn
  • Start date Start date
J

jn

can someone tell me why this code would not work?

want to suppress pageup and pagedown. supposedly this
works. however, when i go to the application, there is no
change.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As
Integer)
Select Case KeyCode
' if user presses page down and shift key
Case 34, 16, 2, 33
KeyCode = 0
Case Else
Debug.Print KeyCode, Shift
End Select
End Sub
 
Is it meant to suppress "pageup and pagedown", or, "page down and shift"?
(You say one thing in one place, and another in the other place.)

Does it hit the keycode=0 line?

TC
 
i was looking for pageup (33), pagedown (34) and shift (16)
i found some information yesterday that indicated that the
key preview needed to be set to yes.
when i did that 33 and 34 worked. it did not stop 16.

i am trying to prevent the shift bypass at startup.

i have keyed the code that is on the web or in access help
about setting the allowbypasskey to false but that does
not work or i do not have info that something else needs
to be set.
 
did that but now am getting errors when i key the function
name in the autoexec macro.
i key as function name changepropertyddl. if i key as
changepropertyddl(), i get a msg indicating incorrect
number of arguments. if i key as changepropertyddl
(stpropname, proptype, vpropval), i get can not find
strpropname.
i can not find in access help or web help the syntax for
function name in macros.

thanks
 
tried doing a docmd.openmodule on form open. the module
was the one identified on the website.

still did not work. so bottom line is i need the nitty
gritty on what it is i am doing wrong.

thanks
 
1. Create the module (I assume you have already done this).
2. Open the Code Window (Ctrl + G)
3. Open the Immediate Window (look under the view menu)
4. Type in the name of the module with the name and full path to the
database in parentheses. Be sure to put the path and name of the database in
double quotes.
5. Press Enter.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
 
lynn, thanks for all your help. i hate to be a pain, but
as you already know, i am rooky at this part.
can you tell me the syntax of 4 or where i can find?

thanks
 
Back
Top