Combine two fields

R

rml

I'm trying to display (combine) two fields on a form using the following:

=Trim([RE] & ", " & [RENO])

But getting an error. #Name?

What am I doing wrong?

Thanks.
 
A

Allen Browne

I'm guessing that the Name of this text box is either RE or RENO?

Change the Name property to something else, such as txtReAndReNo.

Access gets confused if the text box has the same name as a field, but it is
bound to something else.
 
R

rml

The box that I'm trying to get the two fields to combine in is called
text159. The other two fields are RE and RENO. I have tried some of the
other suggestions but still no luck.

What am I doing wrong?

Allen Browne said:
I'm guessing that the Name of this text box is either RE or RENO?

Change the Name property to something else, such as txtReAndReNo.

Access gets confused if the text box has the same name as a field, but it is
bound to something else.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

rml said:
I'm trying to display (combine) two fields on a form using the following:

=Trim([RE] & ", " & [RENO])

But getting an error. #Name?

What am I doing wrong?

Thanks.
 
S

SusanV

Are textboxes for RE and RENO included in the form? If not, you need to add
them - you can stick them anywhere and set the visible property to NO for
visual preference, then use the actual name of these textboxes prefixed by
Me. In other words, if the textbox holding the RENO data is called txtReno,
you would reference it in your code as Me.txtReno.

Hope that clears things a bit,
--
SusanV

rml said:
The box that I'm trying to get the two fields to combine in is called
text159. The other two fields are RE and RENO. I have tried some of the
other suggestions but still no luck.

What am I doing wrong?

Allen Browne said:
I'm guessing that the Name of this text box is either RE or RENO?

Change the Name property to something else, such as txtReAndReNo.

Access gets confused if the text box has the same name as a field, but it
is
bound to something else.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

rml said:
I'm trying to display (combine) two fields on a form using the
following:

=Trim([RE] & ", " & [RENO])

But getting an error. #Name?

What am I doing wrong?

Thanks.
 
R

rml

Yes, they are on the form.

SusanV said:
Are textboxes for RE and RENO included in the form? If not, you need to add
them - you can stick them anywhere and set the visible property to NO for
visual preference, then use the actual name of these textboxes prefixed by
Me. In other words, if the textbox holding the RENO data is called txtReno,
you would reference it in your code as Me.txtReno.

Hope that clears things a bit,
--
SusanV

rml said:
The box that I'm trying to get the two fields to combine in is called
text159. The other two fields are RE and RENO. I have tried some of the
other suggestions but still no luck.

What am I doing wrong?

Allen Browne said:
I'm guessing that the Name of this text box is either RE or RENO?

Change the Name property to something else, such as txtReAndReNo.

Access gets confused if the text box has the same name as a field, but it
is
bound to something else.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I'm trying to display (combine) two fields on a form using the
following:

=Trim([RE] & ", " & [RENO])

But getting an error. #Name?

What am I doing wrong?

Thanks.
 
S

SusanV

Do you truly need the Trim function? If so, Trim each separately in the
concatenation:

Me.text159 = Trim(Me.txtRE) & ", " & Trim(Me.txtRENO)

This assumes the names of the textboxes for RE and RENO are txtRE and
txtRENO.


rml said:
Yes, they are on the form.

SusanV said:
Are textboxes for RE and RENO included in the form? If not, you need to
add
them - you can stick them anywhere and set the visible property to NO for
visual preference, then use the actual name of these textboxes prefixed
by
Me. In other words, if the textbox holding the RENO data is called
txtReno,
you would reference it in your code as Me.txtReno.

Hope that clears things a bit,
--
SusanV

rml said:
The box that I'm trying to get the two fields to combine in is called
text159. The other two fields are RE and RENO. I have tried some of
the
other suggestions but still no luck.

What am I doing wrong?

:

I'm guessing that the Name of this text box is either RE or RENO?

Change the Name property to something else, such as txtReAndReNo.

Access gets confused if the text box has the same name as a field, but
it
is
bound to something else.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

I'm trying to display (combine) two fields on a form using the
following:

=Trim([RE] & ", " & [RENO])

But getting an error. #Name?

What am I doing wrong?

Thanks.
 
Top