Disable PgUp/PgDn

clippernetclippernet Member Posts: 38
Hello Forum,

is there a way to disable the PgUp/PgDn Keys on a form? Please note that I don't want to change the underlying filter, I just want to prevent users from accidentally changing records...

Thanks in advance,
Beo Lutz

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Put a SETRANGE(field,value) in the OnOpenForm-trigger, so people can't browse through the records.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • clippernetclippernet Member Posts: 38
    Thanks luc,

    however, as I said, I don't really want to change the filter, I just want to disable the keys - is that possible?

    The reason is: The scroll wheel of the mouse does PgUp/PgDn keys, and I want to prevent users from accidentally changing records.
  • MTCMTC Member Posts: 159
    I'm not quite sure of what you want to do here. Do you want to stop the user from moving to the previous or the next record?

    If so, why not simply set the filter onto a single record and disable inserting of new record?

    If you don't want to do it that way, then I don't know of a way to disable keys, but you can stop the user moving to the previous and next records by manually dealing with the OnFindRecord and OnNextRecord triggers. Maybe it's simply the OnNextRecord trigger, I can't quite remember at the moment.

    I have a code snippet somewhere that does this.

    EDIT: I don't have the code example at hand, so I just did a quick test. If OnNextRecord is blank, a simple EXIT(Steps) will stop the user moving it seems. It does not stop the user clicking on the first and last record buttons however. You would have to deal with that in the OnFindRecord trigger.

    EDIT: A simple EXIT(TRUE) in OnFindRecord does the trick, but I did a GET in on open form to set the record.

    You will have to have a play with this to get it to do exactly what you want.
  • ara3nara3n Member Posts: 9,255
    another option is to not give users mouse with scroll wheel. Or a keyboard without pageup and pagedown keys. :mrgreen:
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.