field formula for newbie

A

Alice Holbrow

I'm not well-versed in Access, and I'm hoping someone can give me a
simple fix for my dilemma. I want to create a new field (NewID) in a
table that looks up the data in a different field (CurrentID) in that
same table and then drops the first character.

So if the value in CurrentID is 012345, the value in New ID will be
12345
if the value in Current ID is 022345, the value in New ID will be
22345.

Any help will be greatly appreciated!

Thanks,
aj
 
J

Jeff Boyce

Alice

I'll suggest that, rather than redundantly storing a fact you already have,
consider using a query to retrieve what you're after.

Look into using either a Format() function or something like the Mid() or
Right() functions.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John W. Vinson

I'm not well-versed in Access, and I'm hoping someone can give me a
simple fix for my dilemma. I want to create a new field (NewID) in a
table that looks up the data in a different field (CurrentID) in that
same table and then drops the first character.

So if the value in CurrentID is 012345, the value in New ID will be
12345
if the value in Current ID is 022345, the value in New ID will be
22345.

Any help will be greatly appreciated!

Thanks,
aj

YOu cannot do this in a table, and as a rule you shouldn't do it at all! If
NewID is derived from CurrentID, you can do it in a *query*. Assuming that
CurrentID is a Text field (not a number) and that you want to blindly discard
the first character, whatever it is (e.g. 512345 and 012345 and 912345 all
become 12345), the calculated field would be

NewID: Mid([CurrentID], 2)

Perhaps you could explain the context, why you're doing this, and what you'll
be doing with the result - there may be a better solution.
 

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