access 2000 form field

  • Thread starter Thread starter Ann Marie Bette
  • Start date Start date
A

Ann Marie Bette

Hi,
I was wondering if anyone can help me with formulating
syntax to automatically build an email address on a form?
I work at a school district and everyone's e-mail address
is made up of lastname, first initial of first name and
@xyzschool.us

If I have a form that has a field for lastname as well as
firstname I thought I could save my users from entering
an email address. I need to attach a function to my e-
mail field textbox control but I am not sure what the
syntax is. I was looking up information on the String and
Left functions. Somehow I would imagine I need to use a
combination of both but I'm afraid I am not sure how. Any
help is greatly appreciated. Many thanks in advance for
your assistance with this matter.
Ann Marie Bette
 
Ann Marie,

I will give you some syntax to do what you are asking, but
be aware that parents love to give their kids first names
starting with the same letter, so you will probably put in
some bad addresses occasionally. I will include LCase() to
strip capital letters from the names. This should probably
go in the AfterUpdate event of your last name field entry
and has no error handling if names are missing.

Me!Email = LCase(Left([FirstName],1)) & LCase([LastName]) &
"@xyzschool.us"

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
"Ann Marie Bette" <[email protected]>
wrote in message
news:[email protected]...
 
Hi there,
THANK YOU SO MUCH for your reply! I actually attached the
syntax to the email field textbox on my form, disabling
and locking the control and also setting the tab stop
property to "no". The only thing I had to do was reverse
the order because it's lastname first initial of first
name and of cause modify the field names being referenced
but it worked like a charm!!!
-----Original Message-----
Ann Marie,

I will give you some syntax to do what you are asking, but
be aware that parents love to give their kids first names
starting with the same letter, so you will probably put in
some bad addresses occasionally. I will include LCase() to
strip capital letters from the names. This should probably
go in the AfterUpdate event of your last name field entry
and has no error handling if names are missing.

Me!Email = LCase(Left([FirstName],1)) & LCase ([LastName]) &
"@xyzschool.us"

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
"Ann Marie Bette" <[email protected]>
wrote in message
Hi,
I was wondering if anyone can help me with formulating
syntax to automatically build an email address on a form?
I work at a school district and everyone's e-mail address
is made up of lastname, first initial of first name and
@xyzschool.us

If I have a form that has a field for lastname as well as
firstname I thought I could save my users from entering
an email address. I need to attach a function to my e-
mail field textbox control but I am not sure what the
syntax is. I was looking up information on the String and
Left functions. Somehow I would imagine I need to use a
combination of both but I'm afraid I am not sure how. Any
help is greatly appreciated. Many thanks in advance for
your assistance with this matter.
Ann Marie Bette


.
 
Back
Top