![]() |
IOBit Software
|
|
|
||||||
| Programming Place to discuss programming including HTML, Java, C++, MySQL and others. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I have tried this module and what is happening is that It cuts off the last number and still gives me the last digit of all Alpha Ex:
thisis the total number 168577 or 114536A this is the ParseNumeric code which cuts off the last digit 16857 or 117711 this is the ParseAlpha which still puts in numeric data as well 7 or A Option Compare Database Option Explicit Function ParseAlpha(ByVal Mystring As String) As String ParseAlpha = Right(Mystring, 1) End Function Function ParseNumeric(ByVal Mystring As String) As Single ParseNumeric = Left(Mystring, Len(Mystring) - 1) End Function '********************************************************************************************** Public Sub Test() 'the following goes into the form event code or wherever. 'to get the separate values follow the example below. Dim MyStringValue MyStringValue = "123456A" '*arbitrary variable just to test with make sure you dim the variable properly. ParseAlpha (MyStringValue) ParseNumeric (MyStringValue) |
| Sponsored links |
|
|
|
#2
|
||||
|
||||
|
this is why I made it modular.. don't call the function if it doesn't have any alphanumeric character.. for that we will need to test .
something I didn't know when I wrote the functions was that you'd have values that DIDN'T have an alpha at the end. I'll be right back with updated code.
__________________
"The American people will never knowingly adopt Socialism..." -Norman Thomas |
|
#3
|
||||
|
||||
|
ok..I've determined that I'm going to shoot verizon.. my internet connection has gone down today more than a prom queen.
any way.. on to the goods. this is the NEW module. toss out or over write the old one with this one. --------------------------------------------------------------------------------- PHP Code:
here is your call to it. PHP Code:
__________________
"The American people will never knowingly adopt Socialism..." -Norman Thomas |
|
#4
|
|||
|
|||
|
I'm so sorry. But this is what I'm trying to do I wasn't quit clear
on my explanation I do apologize. I need for Supp Issue the entire number is needed it shouldn't cut it off.. For the Issue I need just the Alph not the numeric value for replacement of the numeric value it can be N/A Supp Issue: ParseNumeric([Test Table]![WOT Order Tool Number]) Issue: ParseAlpha([Test Table]![WOT Order Tool Number]) WOT Order Tool |Supp Issue | Issue | ---------------------------------------------------------------- | 114536A | 114536 | A | ---------------------------------------------------------------- | 117711A | 117711 | A | ---------------------------------------------------------------- | 134234C | 134234 | C | ---------------------------------------------------------------- | 138748A | 138748 | A | ---------------------------------------------------------------- | 157217B | 157217 | B | ---------------------------------------------------------------- | 167652B | 167652 | B | ---------------------------------------------------------------- | 168577 | 16857 | 168577 N/A | ---------------------------------------------------------------- | 168578 | 16857 | 168578 N/A | ---------------------------------------------------------------- |
|
#5
|
||||
|
||||
|
then your call should be the following..
PHP Code:
here's a sample of the data that I input to test 123456 and 12345A if WOTOT=123456 is entered then the value that returns is 123456 and N/A for 12345A it returns 12345 and A (split from the 12345. )
__________________
"The American people will never knowingly adopt Socialism..." -Norman Thomas |
| Sponsored links |
|
|
|
#6
|
|||
|
|||
|
Thank you so much I had to play with the code a bit now it works perfectly. Thanks for all your help.
Function ParseAlpha(ByVal Mystring As Variant) As String If IsNumeric(Mystring) Then AlphaValue = "N/A" Else AlphaValue = Right(Mystring, 1) End If ParseAlpha = AlphaValue End Function |
|
#7
|
||||
|
||||
|
glad it worked out for you
![]()
__________________
"The American people will never knowingly adopt Socialism..." -Norman Thomas |
![]() |
| Thread Tools | |
| Display Modes | |
|
|