[AccessD] A2010: vbBackspace or vbKeyDelete not recognised

Darren - Active Billing darren at activebilling.com.au
Tue Nov 20 18:19:30 CST 2018


Hi Team,

 

Just writing a simple touch pad/num pad for entering numbers into a field (For a Touch screen POS app – No mouse/keyboard interactions)

 

Found some code on the ‘nets and it’s working nicely for the most part except for Backspace/Delete.

 

12 Buttons on the screen – All assigned 0 through to 9 and one for “Enter” and one for “Backspace/Delete”. Simple enough.

 

Here’s the code

 

Option Compare Database

Option Explicit

 

Private Sub TypeAlphaNum(intKeyCode As Integer)

    Screen.PreviousControl.SetFocus

    Me.txtDisplay.Value = Me.txtDisplay.Value & Chr(intKeyCode)

End Sub

 

Private Sub cmd0_Click()

    TypeAlphaNum vbKey0

End Sub

Private Sub cmd1_Click()

    TypeAlphaNum vbKey1

End Sub

Private Sub cmd2_Click()

    TypeAlphaNum vbKey2

End Sub 

 

And so on for all keys/buttons.But it fails in the on click of the Key assigned for vbBackSpace 

 

I have also tried vbKeyDelete too – this one just adds dots to the ‘display’ 

 

 

The line below just errors out – Compile Error Variable Not Defined

 

Private Sub cmdBackSpace_Click()

    TypeAlphaNum vbKeyBackspace

End Sub

 

Have also tried

 

Private Sub cmdBackSpace_Click()

    Dim vbKeyBackspace  as integer

TypeAlphaNum 8  ‘and various other combinations of numbers

End Sub

 

 

And this just adds dots at the end of the display

 

Private Sub cmdBackSpace_Click()

    TypeAlphaNum vbKeyDelete

End Sub

 

Any suggestions?

 

Many thanks in advance.

 

Darren



More information about the AccessD mailing list