Replace Value in String

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
 
B

Bruce M. Thompson

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"
 

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