ChrisLeicester
Member
- Local time
- Today, 05:31
- Joined
- Feb 14, 2025
- Messages
- 36
Hi All
I am designing a 'Key Pad' to be used as a subform within a Till Page, one to ensure only numbers are entered and to ease use on a touch screen monitor.
It is a simple form with a textbox to store the numbers entered and 12 buttons, 0 to 9, a back button and a "." button. I have the vba working for each number button, for example [NumberEntered] = [NumberEntered] & "1" and the back button working where it cuts the last number off the text box only if the length is bigger than zero (trying to delete number from a zero content text box crashes the vba so this check is necessary.
I am trying to now validate the user entries and stop the idiot entries, for example £123.56.78 is not a possible number, so I would like to stop the user entering two "."
I thought about checking if the 3rd from right character is a period, and if so doing nothing if the period button is pressed, this would stop the user being able to enter a text with 2 periods but am unsure how to do this, In String and In string reverse returns the character position from the left and I need it from the right.
Similarily, I need to also validate that i have only 2 characters after the period so the user cant enter a payment of for example £23.167
any thoughts, and am I tackling this the correct way.
Thanks
Chris
I am designing a 'Key Pad' to be used as a subform within a Till Page, one to ensure only numbers are entered and to ease use on a touch screen monitor.
It is a simple form with a textbox to store the numbers entered and 12 buttons, 0 to 9, a back button and a "." button. I have the vba working for each number button, for example [NumberEntered] = [NumberEntered] & "1" and the back button working where it cuts the last number off the text box only if the length is bigger than zero (trying to delete number from a zero content text box crashes the vba so this check is necessary.
I am trying to now validate the user entries and stop the idiot entries, for example £123.56.78 is not a possible number, so I would like to stop the user entering two "."
I thought about checking if the 3rd from right character is a period, and if so doing nothing if the period button is pressed, this would stop the user being able to enter a text with 2 periods but am unsure how to do this, In String and In string reverse returns the character position from the left and I need it from the right.
Similarily, I need to also validate that i have only 2 characters after the period so the user cant enter a payment of for example £23.167
any thoughts, and am I tackling this the correct way.
Thanks
Chris