2 text boxes to 1 text box

SD23

Registered User.
Local time
Today, 05:36
Joined
Jun 13, 2006
Messages
60
I have a form with a box for the first name of a user and another box for the last name of the user. On another form, I want the first and last name to appear in the same box. Any ideas on how to do the code for this. I am very new at this. Thanks for your help.
 
SD23 said:
I have a form with a box for the first name of a user and another box for the last name of the user. On another form, I want the first and last name to appear in the same box. Any ideas on how to do the code for this. I am very new at this. Thanks for your help.

is your first form bounded to a table ? is the second one an independent form? or is it a subform? are they both open at the same time?

very littel information to work with.

sam
 
Sorry for the lack of information. My first form is opened first and it is bounded to a table. Whatever information I put in this form, gets updated to a table. On the bottom of the first form is a button. After you are completed with this form, you click the button and it takes you to the second form. The forms are not open at the same time. It is on the second form that I want the first and last name in the same box. Thank you.
 
i am assuming you are talking about a "text box". go to properties | Data | ControlSource and enter =[tablename]![FirstName] & " " & [tablename]![LastName]

sam
 
I tried that but for some reason it did not work. The value for the first and last name in one box also gets updated into the table. Im not sure if that matters.
 
That should work. Did you get an error message? What happened when you tried it? Are you using an unbound text box? Are the first and last name fields in the data source for your second form?
 
I did not get an error message. In the one box where the first and last name combined should be is "#Name." The box where it should be combined is unbound.

Basically the first form has two seperate fields for the first and last name. After the user is done inputing information, he/she clicks a button and is taken to a second form (subform). On the subform, I want the first and last name to be entered in one box. This combined first and last name should also be updated to a table. Hope this gives a clearer picture. I really appreciate your help. Thanks.
 
you can also assign the value on the onclick event. or on the on open event.
 
Open the second form without closing the first one. Then in the form_Open event write:

Dim str1 as string, str2 as string

str1 = Forms!frmFirst!Lastname
str2 = Forms!frmFirst!Firstname

Me!txtTextbox.Text = str1 & " " & str2

SD23 said:
I have a form with a box for the first name of a user and another box for the last name of the user. On another form, I want the first and last name to appear in the same box. Any ideas on how to do the code for this. I am very new at this. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom