[AccessD] Access KeyCodes

Steve Conklin developer at ultradnt.com
Fri May 4 10:03:43 CDT 2007


Is the form's key preview property set to true/yes?
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Barbara Ryan
Sent: Friday, May 04, 2007 5:53 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Access KeyCodes

Max....Using a class may help.  Check out the downloads (on
classes/framework) on John Colby's site at http://www.colbyconsulting.com/
.....Barb




----- Original Message -----
From: "Max Wanadoo" <max.wanadoo at gmail.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Friday, May 04, 2007 3:25 AM
Subject: [AccessD] Access KeyCodes


> Dear All,
> In the ONKEYDOWN Event of a control on my form when using Event Procedures

> I
> get the following code created:-
>
> Private Sub R1C1_KeyDown(Keycode As Integer, Shift As Integer)
>  Call pfKeyPress(Keycode) ' I then add in my function to call to handle 
> the
> key pressed by user
> End Sub
>
> However, I have 81 such controls in a 9x9 grid and the above code is
> repeated 81 times and I would like to remove all this
>
> and replace them all with a direct call to a function, for example if I
> wanted to call my own procedure to handle form events I
>
> normally use the following format in the ONEVENT that I was interested in,
> eg ONENTER:-
>
> =pfSetStartPoint(Form) 'in here would be my code to handle the control 
> that
> had, in this example, been entered.
>
>
> Access understands and  passes the value of (Form) which is the name of 
> the
> current form.  This means there is no code on
>
> the form event and all code can sit in a public procedure which can be 
> used
> by any form that calls it.
>
> My problem is that if I use the format =pfKeyCode(KeyCode) to replace the
> ONKEYDOWN Event it complains that it does not
>
> contain the automation value of KeyCode.  It DOES understand (Form) but 
> not
> (KeyCode).
> Does anyone know how to get the value of KeyCode?
>
> Thanks
> Max
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list