A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text Box Control Source



 
 
Thread Tools Display Modes
  #1  
Old October 10th, 2007, 11:34 PM posted to microsoft.public.access.reports
AlwaysFroosh!
external usenet poster
 
Posts: 34
Default Text Box Control Source

I have a text box that I want to report a certain field for most records in a
query, but when it gets to certain records it needs to report another field.
Therefore I have put an IIF statement into the textbox. It produces "#error".
While troubleshooting it I realized that the second I put the field into a
formula it produces an error, even if there's not really any calculation.

What I mean is, if I put this:

FIELDNAME

in the control source it works fine. If I put this:

=[FIELDNAME]

in the control source it immediately produces an error.

I think I'm overlooking something pretty simple here, but it's got me stumped.

Thanks,
Graham
  #2  
Old October 10th, 2007, 11:51 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Text Box Control Source

On Wed, 10 Oct 2007 15:34:00 -0700, AlwaysFroosh! wrote:

I have a text box that I want to report a certain field for most records in a
query, but when it gets to certain records it needs to report another field.
Therefore I have put an IIF statement into the textbox. It produces "#error".
While troubleshooting it I realized that the second I put the field into a
formula it produces an error, even if there's not really any calculation.

What I mean is, if I put this:

FIELDNAME

in the control source it works fine. If I put this:

=[FIELDNAME]

in the control source it immediately produces an error.

I think I'm overlooking something pretty simple here, but it's got me stumped.

Thanks,
Graham


When the control source of a control is an expression (i.e.
=[FieldName]), the name of that control cannot be the same as the name
of a field used in the expression.
Just change the name of the control.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old October 11th, 2007, 12:06 AM posted to microsoft.public.access.reports
AlwaysFroosh!
external usenet poster
 
Posts: 34
Default Text Box Control Source

Thanks for the speedy reply fredg. I found this piece of advice elsewhere on
the form before I posted, but when I read it the first time I didn't quite
clue in to the problem. The name of my controls displaying the query results
are just the defaults, like Text12 for example. I tried changing this anyways
and of course it made no difference.

When I read your reply I thought of what the problem is. I have Labels at
the top of my form that are named the same as the fields from the query. I
didn't realize that the name of the field from the query couldn't be the same
as the name of ANY control on the form. Whoops! All good now, thanks for your
help.

Graham

"fredg" wrote:

On Wed, 10 Oct 2007 15:34:00 -0700, AlwaysFroosh! wrote:

I have a text box that I want to report a certain field for most records in a
query, but when it gets to certain records it needs to report another field.
Therefore I have put an IIF statement into the textbox. It produces "#error".
While troubleshooting it I realized that the second I put the field into a
formula it produces an error, even if there's not really any calculation.

What I mean is, if I put this:

FIELDNAME

in the control source it works fine. If I put this:

=[FIELDNAME]

in the control source it immediately produces an error.

I think I'm overlooking something pretty simple here, but it's got me stumped.

Thanks,
Graham


When the control source of a control is an expression (i.e.
=[FieldName]), the name of that control cannot be the same as the name
of a field used in the expression.
Just change the name of the control.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.