Alan, Sorry, the last line should have read the form KeyPreview property NOT event...but I'm sure you understood.
Dave Crozier -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dave Crozier Sent: 13 December 2006 16:26 To: 'ProFox Email List' Subject: RE: SetFocus from ActiveX control event. Alan, Found a slightly better solution. In the BeforeCellEdit of the control, simply cancel the edit and then fire up the keyboard with say ctrl/a *** ActiveX Control Event *** LPARAMETERS nindex, ncolumn This.CancelEdit Keyboard '{ctrl+a}' * Return Then in the form keypress Event you can direct your setfocus anywhere: * Form Keypres() LPARAMETERS nKeyCode, nShiftAltCtrl If nKeyCode=1 Thisform.txtId.SetFocus Nodefault * Else Dodefault() Endif * Return Just make sure that the Form Keypreview event is set correctly. Doing it this way means you can control the setfocus wherever you want to. Dave Crozier -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alan Bourke Sent: 13 December 2006 15:06 To: [email protected] Subject: SetFocus from ActiveX control event. I've got a VFP9 form with the DBI Technologies CTGrid control on it. >From that control's CellClick event I want to SetFocus to another control on the form. The other control is dervied from a container parent class which has two textboxes in it. I'm trying to SetFocus to one of the TextBoxes, but it doesn't work. Has anyone got any suggestions ? TIA ... -- Alan Bourke [EMAIL PROTECTED] -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

