Changing three text values in Table

  • Thread starter Thread starter google3luo359
  • Start date Start date
G

google3luo359

Would someone be able to help me with VB code to achieve the following?
I have a *text* field in a table that holds four values; 9, 10, 11, or
12.

I'm trying to write a query that will update the 9 to a 10, the 10 to
11, and the 11 to 12.
I had no problem writing it when the field was a number field, but now
that it's text it seems more tricky to achieve.

TIA Ric
 
well, if you're using an Update query, try

CByte(tablename.fieldname)+1

the expression converts the text to numbers, does the math, then stores the
new values as text (because the field is Text data type).

hth
 
tina said:
well, if you're using an Update query, try

CByte(tablename.fieldname)+1

the expression converts the text to numbers, does the math, then stores the
new values as text (because the field is Text data type).

hth


Wow that is some amazing function!
It works perfectly for my situation. Thanks a lot Tina.

Ric
 

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