Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2007

Tip: Looking for answers? Try searching our database.

Text Box Control Source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AlwaysFroosh! - 10 Oct 2007 23:34 GMT
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
fredg - 10 Oct 2007 23:51 GMT
> 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.
[quoted text clipped - 16 lines]
> 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.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

AlwaysFroosh! - 11 Oct 2007 00:06 GMT
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

> > 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.
[quoted text clipped - 21 lines]
> of a field used in the expression.
> Just change the name of the control.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.