need help with separating text in forms

J

jkendrick75

I have a form where it asks for a name, and the user enters a name "John
Smith".
what i want it to do is automatically populate another text box on the same
form for email address. my company uses the first and last names without a
space for our email scheme. what i want the email text box to show for this
example is "[email protected]". how do i get the space between the names
to disappear, without changing the table format or the form format.
thanks for any help you are able to give.
 
V

Van T. Dinh

Check Access VB Help on the Replace() function which you can use to replace
space with an empty String.
 
J

jkendrick75

using access 2000, not sure how to do what you suggested, help files are not
showing anything for the Replace() function.
 
R

Rick Brandt

jkendrick75 said:
using access 2000, not sure how to do what you suggested, help files
are not showing anything for the Replace() function.

You have to make sure your looking in help for VBA, not help for Access.

You can also open the immediate window, type "Replace", put your cursor on
the word and press <F1>.
 
J

jkendrick75

all i'm seeing in the help files is for the SelLength, SelStart, and SelText
Properties, but when i look through that, i don't see an example that will
help me in my situation. thanks for the replies though... any other ideas
will be much appreciated.
 
R

Rick Brandt

jkendrick75 said:
all i'm seeing in the help files is for the SelLength, SelStart, and
SelText Properties, but when i look through that, i don't see an
example that will help me in my situation. thanks for the replies
though... any other ideas will be much appreciated.

Did you try the trick with the immediate window and the <F1> key? I just
tested that in Access 2000 and it took me directly to the help topic for
Replace().

Anyway the syntax is...

Replace(expression, find, replace[, start[, count[, compare]]])
 
A

Albert D.Kallal

In your text box, simply put:

=([FirstName] & [LastName] & "@yahoo.com")

Of couse, change the @yahoo to whatever you need in you case...
 
Top