creating automatic email address...

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
 
J

Jonathan Parminter

-----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
 

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