Replace Value in String

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi

I have the value of a piece JH32-1 and I want to replace
the value 32 by XX

The value of the piece are from JH32-1--> JH32-99 and I
have JB32-1 --> JB32-99

Can I do the replacement by code, instead of do it
manually

thanks
 
Just to add to what Rob has suggested, if you want only to change that value
where the field's value begins with "JH" (this may *not* be what you were
implying), you will need to test for that condition before executing the
Replace().

'***In Code
If Left([FieldName], 2) = "JH" Then
'Do the replace
End If
'***

Using SQL, you can set the criterion to:

Left([FieldName], 2) = "JH"
 
Back
Top