Removing Last Letters From A Product Code

  • Thread starter Thread starter david.willcocks
  • Start date Start date
D

david.willcocks

Hi All,

Have been tearing my hair out (what I have left) trying to figure out
the VB for the following;

I have a table which contains a column of Product Code data. At the end
of SOME of the codes there is a letter which denotes a specific variant
of the product. What I am trying to do is remove each of the characters
at the end of a product code until access finds a number, for example
it would turn 123456xhy into 123456. If there is no letters then it
would ignore the code and carry on to the next one.

Is anyone able to offer any advice

Many Thanks

David Willcocks
 
Create an Update query (Update on Query menu.)

Update the [Product Code] field to:
Val([Product Code])

Include the criteria:
Not Null

Val() returns the leading number part of a string.
 

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

Back
Top