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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|