Help with Coding - alpha to numeric

N

NNlogistics

Im trying to change an an alpha string to a number. It will work to change
PM0000193-2 to 800001932 but not PM0000193-21 to 8000019321. The contol
source for the txtRMANumber is Number-Long Integer. Me.txtPOtoRMATransision
and Me.txtPOtoRMATransision2 are unbound and were added during my trouble
shooting process. I'm using msgbox to help troubleshoot. I hope this is
clear.

happy New Year to all!



' Change PO number to RMA # if Customer Number is 1
' if not 1 then go to fldseqnumber and add 1 for the RMA Number

If txtCustomerID = "1" Then 'using PM0000193-2 and PM0000193-20 as
examples
Me.txtPOtoRMATransision = Left(Me.txtPONumber, 9) & Mid(Me.txtPONumber, 11,
2) 'gives PM00001932 and PM000019320 repectively to get rid of "-"
MsgBox (Me.txtPOtoRMATransision) 'gives PM00001932 and PM000019320 repectively
Me.txtPOtoRMATransision2 = "8" & Mid(Me.txtPOtoRMATransision, 3)
MsgBox (Me.txtPOtoRMATransision2) 'gives 800001932 and 8000019320

Me.txtRMANumber = Me.txtPOtoRMATransision2 - Here's where I'm getting run
time error 2147352567 The value you entered isn't valid for this filed

Me.txtSalesOrderNumber.SetFocus 'Then enter Sales Order Number
Exit Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top