Results 1 to 5 of 5
  1. #1
    jharding08 is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    6

    Adding entered values in numeric textbox to existing values

    Is it possible to have a bound textbox formatted as numeric where a user can enter a new value, something like "+10" and textbox shows the current value +10 as the new textbox value?



    Also if the dont enter the "+", it just overwrites the value?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If "bound" and "formatted as numeric" means textbox is bound to a number type field, answer is "no".

    On second thought, if resulting error can be trapped in VBA then could possibly read the current input value and the old value and adjust field value accordingly. But I suspect this will fail because number field simply cannot accept non-numeric input and likely this is not a VBA trappable error.

    Provide unbound textbox for user input and VBA would manage adjusting field value.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jharding08 is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    6
    Quote Originally Posted by June7 View Post
    If "bound" and "formatted as numeric" means textbox is bound to a number type field, answer is "no".
    What about if not using the "+", just entering a numeric value to add to existing value? Which textbox event would handle this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Value and OldValue are properties of textbox. Code in textbox BeforeUpdate event can grab old value and new value and add them and set field value.

    Why would you want this?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    What does "add" mean here?
    If it contained 10 and I enter 10, the result is 10+10? 20? 1010? Something else?
    The only way you can do #1 or #3 is to use a text field.
    Or do you want to format/display my 10 entry as +10?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 06-01-2020, 07:19 PM
  2. Ordering Numeric Values
    By kazaccess in forum Access
    Replies: 7
    Last Post: 12-31-2013, 02:00 PM
  3. Only show numeric values
    By dr4ke in forum Queries
    Replies: 2
    Last Post: 07-22-2012, 05:09 AM
  4. Setting Up DB with numeric values
    By dashingirish in forum Access
    Replies: 4
    Last Post: 02-17-2012, 03:41 PM
  5. Updating Numeric Values
    By dssrun in forum Queries
    Replies: 9
    Last Post: 11-24-2010, 11:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums