Dlookup with Left(String,Value)/Right(String,Value)

xPaul

Registered User.
Local time
Today, 13:14
Joined
Jan 27, 2013
Messages
65
All,

I am now trying to tip toe into priviledges. For example, if the user has admin priviledges he/she can go into/see locked places of the Form.

I have a table with all of my users set up. The table headings are as follows:

Name-Email Address-Number-Priviledge

Basically, on the form load I wish to have a DLookup to check the priviledge level for the particular user that is using the form, and give access depending on their level.

The issue I am having is trying to remove the last 13 characters from the email address as these last 13 characters never change. For example billbo.baggins@werstern.com, billy.blogs@werstern.com, although their first and last names change, everything after the @ is the same length.

How can I go about removing the last 13 characters of the email address in VBA, without it affecting the record held in the BE?

I have tried Right(billy.blogs@werstern.com,13) - returns the last 13 characters - does not remove them.
Left(billy.blogs@werstern.com,13) - retruns the first 13 characters - this won't work as the first and last name length always changes.

Thanks
 
Hey Paul,

You could use the combination of Mid and InStr, to get this.. Something like..
Code:
? Mid("billy.blogs@werstern.com", 1, InStr("billy.blogs@werstern.com","@")-1)
billy.blogs
 

Users who are viewing this thread

Back
Top Bottom