Using keydown on multiple controls (1 Viewer)

Fizzio

Chief Torturer
Local time
Today, 05:12
Joined
Feb 21, 2002
Messages
1,885
I am creating an appointment system for multiple users, showing multiple diaries. I have a keydown event that indicates if a person has arrived, is being seen or has left using the Fn keys. I have 44 appointment slots and was wondering if there is a way to run the same keydown event on multiple controls rather than having to copy the same code to every individual control keydown event? I have tried to use a macro to call a function to call the sub but all I get is an error referring to the KeyCode variable not being set. Thanks in advance
 
H

hanzo

Guest
Maybe u can consider using modules.

1st u have to create a new module.
2nd Copy and paste the pre-written coding into the new module and then give a name to the function u have created.
3rd. Use the function name in the event procedures of your controls.
4th. If there is any queries, u can try reading help file on modules.

All the best and Good Luck!!
 

Fizzio

Chief Torturer
Local time
Today, 05:12
Joined
Feb 21, 2002
Messages
1,885
Managed to suss it. Tried using functions and modules to ne effect. I had been trying to use the forms keypress event with keypreview on which did not work. I eventually got it working using the keydown event on the form with keypreview on.
 

Users who are viewing this thread

Top Bottom