Textbox Error

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
 
M

Marshall Barton

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.
 
D

David

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.
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top