[AccessD] A2010: vbBackspace or vbKeyDelete not recognised

Arthur Fuller fuller.artful at gmail.com
Wed Nov 21 10:17:27 CST 2018


Clever workaround! But the question (put to MS, not you) is, why is that
key not supported? It makes me wonder what other keys on the numpad are not
supported, such as "/", "*", "-" and "+", also also the decimal point.
Somewhere I had a list of all the vb constants, but cannot locate it at the
moment. A quick Google located it: vb constants list
<https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/constants-and-enumerations>,
in case anyone's interested.

Arthur

On Wed, Nov 21, 2018 at 2:04 AM Darren - Active Billing <
darren at activebilling.com.au> wrote:

> And...ignore me
>
> I used Len() minus 1 to resolve it
>
> Actual code if anyone is interested:
>
> Private Sub cmdBackSpace_Click()
> On Error Resume Next
> Dim strText As String
> strText = Left(txtDisplay, Len(txtDisplay) - 1)
> txtDisplay = strText
> End Sub
>
> Many thanks.
>
> Darren
>
>
> On 21/11/18, 11:19 am, "AccessD on behalf of Darren - Active Billing" <
> accessd-bounces at databaseadvisors.com on behalf of
> 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
>


-- 
Arthur


More information about the AccessD mailing list