removing part of text in field

M

Michelle

I am collecting data from a webform that stores in an
Access Database. One of the fields that I am collecting
is username. When this information is written to the db
it is in the form of domain\username. I would like to
strip the domain portion of it off once it's written. I'm
a beginner so please explain in fairly simplistic terms.

Thanks - Michelle
 
R

RobFMS

Michelle

If you are using Access 2000 or higher, you can use the Split() function.
Using the character "\" as your delimiter, the function will be able to
parse both items and you can reference the specific one you want.

HTH

--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
J

John Vinson

I am collecting data from a webform that stores in an
Access Database. One of the fields that I am collecting
is username. When this information is written to the db
it is in the form of domain\username. I would like to
strip the domain portion of it off once it's written. I'm
a beginner so please explain in fairly simplistic terms.

Thanks - Michelle

One way to do this is with an Update query. Create a Query based on
your table; use a criterion on the username field of

LIKE "*\*"

to limit the records to those with a backslash. Change the query to an
Update query (using the Query menu option, or the query type icon) and
on the Update To line under the username field put

Mid([username], InStr([username], "\") + 1)

Run the query using the ! icon and it should strip off all the domain
names.
 

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