1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| Option Compare Database
Option Explicit
Private Enum MyEvents
ShowNBRows = 1
AutoCompletion = 2
End Enum
Private m_strTextEntry As String
Private m_NoErrors As Boolean
Private Sub ExecuteEvent(ByVal KeyAscii As Integer, WhichEvent As MyEvents)
m_strTextEntry = m_strTextEntry & Chr(KeyAscii)
lblContent.Caption = m_strTextEntry
Select Case WhichEvent
Case ShowNBRows
Call ShowNBRows (m_NoErrors)
Case AutoCompletion
Call AutoCompleteData (m_NoErrors)
End Select
If Not m_NoErrors Then
MsgBox "Event ended successfully !", 64
End If
End Sub
Private Sub Form_Load()
Me!txtEntryData = ""
End Sub
Private Sub txtEntryData_KeyPress(KeyAscii As Integer)
ExecuteEvent KeyAscii, AutoCompletion
End Sub |
Partager