Avatar of rsburge
rsburge
Flag for United States of America

asked on 

Extract Number from Variable, Increase by 1 and Add Back to Variable

Hello Experts -

In Access 2007, I have a variable called EPW.  The value of the variable could be any length up to 50 characters, and any combination of letters, numbers and special characters; for example, %X123cy! or $Hsp1@, etc.

I need to extract the numeric portion, increase it by 1 and then put it all back together in another variable called NPU.

Steps...
1. EPW Value = %X123cy!
2. Extract 123
3. Increase to 124
4. Combine so NPU = %X124cy!

I am a novice with VBA, so the more code example you can provide, the better.

Thank you!
Microsoft AccessProgrammingVBA

Avatar of undefined
Last Comment
Nick67

8/22/2022 - Mon