I want to add remaining things automatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a contact database. In the e-mail field I just want to type username.
All the remaining things have to come automatically after I type user name.
For example my e-mail address is : (e-mail address removed)

After I type m.kutty the remaining @mobily.com.sa have to come
automatically. Because I have a lot of people in the my company to enter in
the contact database. I can save my time by doing this. I Would appreciate
your greate favor.
 
Kutty,

I guess you could put code like this on the After Update event of the
email control...
Me.Email = Me.Email & "@mobily.com.sa"

If you wanted to prevent this from firing when you edit an existing
email address, then maybe this would help...
If InStr(Me.Email,"@") Then
' do nothing
Else
Me.Email = Me.Email & "@mobily.com.sa"
End If
 
Steve,
1) I am not experienced in visual basic coding. I have done the same as
you
suggested as below. But I can see that the remaining stuff except user
name is
coming in the empty field which I left filling email field. But once I
try to enter
new records I can see empty in email field. Why?
2) What you mean by "If you wanted to prevent this from firing when you
edit an
existing email address, then maybe this would help...
What is the use of this :
If InStr(Me.Email,"@") Then
'do nothing
Else
Me.Email = Me.Email & "@mobily.com.sa"
End If

Is there anything to type after End If ?
 
Kutty,

You will need to replace the 'Email' in the code I gave with the actual
name of the email address control on your form. You would put the code
on the After Update event of this textbox. So what it should do then,
is if you type fred in the email address textbox, and then press Enter,
it should automatically change it to (e-mail address removed) which I think is
what you want. And then the other code was to handle if you need to
make alteration to an existing email address. Otherwise if you have
already in there (e-mail address removed) and you want to change to
(e-mail address removed) and you go to edit the data by adding the 'dy' for
'freddy', you will end up with (e-mail address removed)@mobily.com.sa you see.
 
Back
Top