[AccessD] Key Preview Problem

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Thu Mar 16 07:50:17 CST 2006


Stuart:

Same result.

Code now reads:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
'MsgBox KeyCode
    Select Case KeyCode
        Case 116
            Me.pgOrderNumber.SetFocus
            KeyCode = 0
            Me.KeyPreview = True
        Case 117
            Me.pgReceiving.SetFocus
            KeyCode = 0
            Me.KeyPreview = True
        Case 118
            Me.pgProcessing.SetFocus
            KeyCode = 0
            Me.KeyPreview = True
        Case 119
            Me.pgShipping.SetFocus
            KeyCode = 0
            Me.KeyPreview = True
    End Select
  
End Sub

I open the form. Press F6 - Me.pgReceiving gets the focus.  I press F7, 
I get spell check.  The event doesn't fire but once.

Rocky


Stuart McLachlan wrote:
> On 15 Mar 2006 at 21:29, Rocky Smolin - Beach Access S wrote:
>
>   
>> So I've traced it down to the lines Me.pgXXX.SetFocus.  When that line
>> executes it hoses the KeyPreview property and even setting it at the end of
>> the module doesn't help.
>>
>>     
>
> What happens if you set "me.keypreview = true" in code after the SetFocus?
>
>
>
>   

-- 
Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com




More information about the AccessD mailing list