creating automatic email address...

  • Thread starter Thread starter papa
  • Start date Start date
P

papa

Hi,

I need help with the following problem. I currently have
a form with three text fields

Firstname:
surname:
Email address:

What I would like to do is that the email address appears
automatically after you enter the surname and the focus
passes on to the email address....

Is this possible?

i.e. user enters;
Firstname "John", then surname "jones" and when the focus
passes to the email address field it will
have "(e-mail address removed)". The company will always be the
same name.

Any help would be really appreciated.
rgds,
Papa
 
-----Original Message-----
Hi,

I need help with the following problem. I currently have
a form with three text fields

Firstname:
surname:
Email address:

What I would like to do is that the email address appears
automatically after you enter the surname and the focus
passes on to the email address....

Is this possible?

i.e. user enters;
Firstname "John", then surname "jones" and when the focus
passes to the email address field it will
have "(e-mail address removed)". The company will always be the
same name.

Any help would be really appreciated.
rgds,
Papa
.
Hi Papa,
use the following as an example for the code that goes in
the afterupdate event for the surname field.

private txtSurname_AfterUpdate()
txtEmail=txtFirstName & "." & txtSurname & "@abc.com"
end sub

You may like to add a check so that the email field is
first checked to see if it already contains a value. For
example

if isnull(txtEmail) then
txtEmail=txtFirstName & "." & txtSurname & "@abc.com"
end if

Luck & Happy New Year
Jonathan
 
Back
Top