Try this...
In the form event properties set "Key Preview" on
In the form "KeyDown" eventdo a test like
If me.ActiveControl = me.[Name OfSplitterControl] then 'check for downarrow 'set the keycode = 0 if you do not want the keystroke to do anything else 'set the focus where you want
"bhammer" wrote:
[Quoted Text] > I have an ActiveX SplitBar control on my form that works great. It has a > quirk that happens if the user presses the DownArrow key after resizing the > splitbar (i.e., it has the focus). So I want to prevent it, or redirect the > focus. > > I tried setting the focus after the OnChange and DownKey events but the > focus did not move. > > Ideally I would like to move the focus a subform (the splitbar is on the > main). Even better, I'd like to move the focus to the record on the subform > that was current before the user moved the splitbar! (the current record > moves to first, for some reason after the splitbar is moved, also annoying). > > Concept: > Sub Splitbar_Resize() > With Me.Subform > .Setfocus > Form.GoTo.RecordWithPreviousFocus > End Sub > > -Brad
|