Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename Userid

Status
Not open for further replies.

southboy

Programmer
Oct 23, 2002
26
US
I have a database that has tables based on the Windows userid of the person who opened the database. When opened a form opens that the user inputs work information for their job. The form is linked to each of their personal userid tables.

The windows userid's where based on the first initial of the user’s first name and the full last name. Ex... rsouthboy

Unfortunately our admin LAN changed everyone’s userid's to firstname.lastname. Ex... ron.southboy
Now when the database opens you get an error that states "The recordsource for xxxx specified on this form does not exist."

I need some help with code that will take the first character of the new userid and everything after the period and combine them. Ex... ron.southboy to rsouthboy (like their userid's use to be.) I can't rename the tables too their new userid's because of the period now in the new userids. Access won't accept that.
Any help would be greatly appreciated.
 
left(userid,1) & mid(userid,instr(userid,".")+1)
 
or:
Code:
[blue] = Left(UserId, 1) & Right(UserId, Len(UserId) - InStr(1, UserId, "'"))[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Ace:
Should be
= Left(UserId, 1) & Right(UserId, Len(UserId) - InStr(1, UserId, "."))


note:

my method uses 2 functions
yours 3
 
pwise . . .

OOoooops! [blush] Howd that getin there? [surprise]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thank you both for your responce.

Pwise, both of yours worked just right. Output...rsouthboy
Thank you for your help with this.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top