[AccessD] A2010: vbBackspace or vbKeyDelete not recognised

Darren - Active Billing darren at activebilling.com.au
Wed Nov 21 22:17:27 CST 2018


Hi Paul,

Thanks for the suggestion - Sadly...no joy. 

I added vbKeyBack to the sub, then clicked it 3 times, and ended up with 3 x odd characters.

Sample image here:
https://s3.ap-southeast-2.amazonaws.com/assets.activebilling.com.au/Demo/NumPad.png?

Many thanks again for the suggestion - I have reverted to the Len() minus 1 option.
 
Darren
 
------------

On 22/11/18, 3:27 am, "AccessD on behalf of Paul Hartland via AccessD" <accessd-bounces at databaseadvisors.com on behalf of accessd at databaseadvisors.com> wrote:

    Darren,
    
    Have you tried vbKeyBack for the delete key?
    
    Paul
    
    On Wed, 21 Nov 2018, 00:20 Darren - Active Billing <
    darren at activebilling.com.au wrote:
    
    > 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
    >
    > --
    > AccessD mailing list
    > AccessD at databaseadvisors.com
    > http://databaseadvisors.com/mailman/listinfo/accessd
    > Website: http://www.databaseadvisors.com
    >
    -- 
    AccessD mailing list
    AccessD at databaseadvisors.com
    http://databaseadvisors.com/mailman/listinfo/accessd
    Website: http://www.databaseadvisors.com
    





More information about the AccessD mailing list