check if editing

  • Thread starter Thread starter Wendy
  • Start date Start date
W

Wendy

Hi All,
Is thera a wy to programatically check if a particular
field is being edited? I would like to trap the pgup and
pgdn keys but not while a dropdown list is open.

You guys are always a great help.
thanks,

Wendy
 
Wendy

Look at 'KeyPreview' property in the help file. This will allow you to
process the keystrokes before the form events fire. Additionally, look at
the 'ActiveControl' property too.


HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Hi,

I don't know of a way to check if a combo box is dropped down. But to
return the active contol you can use the Screen Object
(Screen.ActiveForm.ActiveControl.Name)

Code would be along the lines of:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyPageDown, vbKeyPageUp
If Screen.ActiveForm.ActiveControl.Name = "cboControlName" Then
' Page buttons allowed
Else
KeyCode = 0
End If
End Select

End Sub

HTH
--

Cheers
Mark

Free Access/Office Add-Ins at:
http://mphillipson.users.btopenworld.com/
 
Back
Top