zelarra821
Registered User.
- Local time
- Today, 19:27
- Joined
- Jan 14, 2019
- Messages
- 835
Hello. I am trying to create a class module for when I press a key. I manage to start it, but not pass the event procedure to the form, and I don't know what I'm doing wrong. Could someone tell me what is failing? Thanks
Code:
Option Compare Database
Option Explicit
Private WithEvents Form As Access.Form
Private mPresionarTecla As Boolean
Public Property Get PresionarTecla() As Boolean
PresionarTecla = mPresionarTecla
End Property
Public Property Let PresionarTecla(ByVal vNewValue As Boolean)
mPresionarTecla = vNewValue
End Property
Public Sub InitalizeAutokeys(FName As Form)
Set Form = FName
If mPresionarTecla = True Then
FName.OnKeyDown = "[Event Procedure]"
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
mPresionarTecla = True
Select Case Shift
Case 2
Select Case KeyCode
Case vbKeyV
rbPegarSinFormato Screen.ActiveControl
End Select
End Select
End Sub