Textbox Error

  • Thread starter Thread starter David
  • Start date Start date
D

David

If I drag from the field list, the data in my textbox displays just fine,
but if I change the Control Source from PartyName to =[PartyName] & ":", the
textbox displays #Error. Other reports contain textboxes with concantenated
data and work just fine. The format property is blank; it's just text. Any
ideas why it won't work?
Thanks in advance!
David
 
David said:
If I drag from the field list, the data in my textbox displays just fine,
but if I change the Control Source from PartyName to =[PartyName] & ":", the
textbox displays #Error. Other reports contain textboxes with concantenated
data and work just fine. The format property is blank; it's just text. Any
ideas why it won't work?

The problem is the name of the text box. When you drag it
from the field list, Access give the text box the same name
as the field. When you change the text box's ControlSource
to an expression that includes the field name, you've
created a circular reference (where the text box refers to
itself).

The solution is to change the name of the text box to
something else such as txtPartyName.
 
Thanks Marsh! I fell a little silly having overlooked that!
D

Marshall Barton said:
David said:
If I drag from the field list, the data in my textbox displays just fine,
but if I change the Control Source from PartyName to =[PartyName] & ":", the
textbox displays #Error. Other reports contain textboxes with concantenated
data and work just fine. The format property is blank; it's just text. Any
ideas why it won't work?

The problem is the name of the text box. When you drag it
from the field list, Access give the text box the same name
as the field. When you change the text box's ControlSource
to an expression that includes the field name, you've
created a circular reference (where the text box refers to
itself).

The solution is to change the name of the text box to
something else such as txtPartyName.
 
David said:
Thanks Marsh! I fell a little silly having overlooked that!

Don't feel too bad, we've all run into that silliness at one
time or another. IMHO, the silliness is in Access using the
field name as the default control name.
--
Marsh
MVP [MS Access]


If I drag from the field list, the data in my textbox displays just fine,
but if I change the Control Source from PartyName to =[PartyName] & ":",
the textbox displays #Error. Other reports contain textboxes with concantenated
data and work just fine. The format property is blank; it's just text.
Any ideas why it won't work?
"Marshall Barton"wrote
The problem is the name of the text box. When you drag it
from the field list, Access give the text box the same name
as the field. When you change the text box's ControlSource
to an expression that includes the field name, you've
created a circular reference (where the text box refers to
itself).

The solution is to change the name of the text box to
something else such as txtPartyName.
 
Back
Top