#Name? Error, text box can not find reference (1 Viewer)

GT_engineer

Registered User.
Local time
Today, 02:50
Joined
Aug 23, 2012
Messages
85
I created a text box with a function for the control source =[Location]*2 where [Location] is a field on the same form (right beside this text box).

I get this error in the text box #Name?


I know this field exists, it's right beside the text box. Funny thing is it worked yesterday. Any ideas? Did I hit a switch or an option that disable functions???
 
Last edited:

apr pillai

Registered User.
Local time
Today, 13:20
Joined
Jan 20, 2005
Messages
707
Look closely whether you have added a space by mistake before/after the word Location, like [ Location]*2 or [Location ]*2
 

pr2-eugin

Super Moderator
Local time
Today, 07:50
Joined
Nov 30, 2011
Messages
8,498
Did you accidentally change the name of the field? Try recreating the field..
 

GT_engineer

Registered User.
Local time
Today, 02:50
Joined
Aug 23, 2012
Messages
85
I am using 2010, so I am using the expression creater hence I am not typing in the word [Location] but chossing it from a list of fields located on the form.

I try deleting and re-adding those fields back into the form, no luck :banghead:
 

GT_engineer

Registered User.
Local time
Today, 02:50
Joined
Aug 23, 2012
Messages
85
Sorry forgot to mention, I don't know if this effects it or not. But the form is in continous view. Thanks for any help
 

GT_engineer

Registered User.
Local time
Today, 02:50
Joined
Aug 23, 2012
Messages
85
Gents, I deleted and recreated the form from scratch, its working now. Thanks

I don't know why this was happening, bug perhaps
 

boblarson

Smeghead
Local time
Yesterday, 23:50
Joined
Jan 12, 2001
Messages
32,068
Just a note. On Reports, if you have a control that uses an expression and that expression refers to a field where there is a control with that same name, you need to change the control name. So, if you are using

=[MyText]

and there is a textbox on the form named MyText and it is bound to a field named MyText, then it will generate the #Name error. If you rename the control to txtMyTest and then still refer to the field using
=[MyText]
it will no longer give the error.
 

GT_engineer

Registered User.
Local time
Today, 02:50
Joined
Aug 23, 2012
Messages
85
yes I noticed that with reports, is that becuase in reports in refers to table fields instead of report(form) fields????
 

ddetding

New member
Local time
Yesterday, 23:50
Joined
Apr 26, 2016
Messages
1
I had this issue also! I was using =[LAST] + ", " + [FIRST] in my control and still no matter the combinations I had no avail to resolve the issue.
I would close my database and each time it opened it would still give me the #name? error. I was using a form with tabs and a continuous subform where my text box with the above information was entered. Luckily I had a command button in my subform also which pulled an error and I found a way to resolve that error which worked for both my button AND the #name? error!
I had to add an empty Form_Load() event to the main form.

that's all. no extra code. Hope this helps anybody else also!
 

zecixx

New member
Local time
Today, 00:50
Joined
May 16, 2016
Messages
1
I had this issue also! I was using =[LAST] + ", " + [FIRST] in my control and still no matter the combinations I had no avail to resolve the issue.
I would close my database and each time it opened it would still give me the #name? error. I was using a form with tabs and a continuous subform where my text box with the above information was entered. Luckily I had a command button in my subform also which pulled an error and I found a way to resolve that error which worked for both my button AND the #name? error!
I had to add an empty Form_Load() event to the main form.

that's all. no extra code. Hope this helps anybody else also!

WORKED! After updating Access All my DLOOKUPs where failing. Something changed, but after adding


Private Sub Form_Load()

End Sub

to my form, things starting working again.
 

starley_rover

New member
Local time
Today, 07:50
Joined
Dec 22, 2014
Messages
8
I had a similar problem but found a work-around.

Scenario: I have a database of at risk Health Care Workers, with a subtable of dates and results of tests. I needed to generate a date twelve weeks after the maximum date entered for each HCW. No problem. I added a text box to the footer of the subform, and this listed the max date, plus 84. On my main form, using the correct syntax, I then referenced the name of this text box and its subform. Everything was fine for a while. Then I got the dreaded #Name?.

I tried everything suggested above. I checked for naming conflicts. I deleted the text boxes, compacted and repaired, recreated the text boxes, rebuilt the form from scratch. Repeatedly. No joy.

After a day, I tried a different tack. Totals query listing unique HCW ids and their maximum dates. Then another query linking this first query to relevant fields from my main table, with a due date (from the max date, plus 84). This second query is now the source of my main form. I hope this helps someone out there.

Thanks for reading

Mark
 

starley_rover

New member
Local time
Today, 07:50
Joined
Dec 22, 2014
Messages
8
Uh oh! This is not a good work-around. Because my form is based upon a totals query, I can't add a new record. Back to where I started. Mark
 

starley_rover

New member
Local time
Today, 07:50
Joined
Dec 22, 2014
Messages
8
Another work around:

My main form is now based upon the table.

My sub form now has a header with a text box with the formula: =Max([sampledate])+84

Changed the subform to continuous.

Added On Load to main form

Private Sub Form_Load()
Me.sbfMonitoring.Form.FormHeader.Visible = True
End Sub

And I can now add records.

(hope you’re still awake ;-)

Mark
 

mqnf

New member
Local time
Yesterday, 23:50
Joined
Jan 3, 2019
Messages
4
Now I'm getting the #Name? error, but none of the above described conditions apply. Any advice would be appreciated.

It is a textbox with Control Source to table "DefSidingTerms" and Column "DefSidingCrackingMaj" written as =[DefSidingTerms]![DefSidingCrackMaj]

The textbox is named "textCrackingMajor"

Nothing else on the Form or table is named the same name.
As you can see, no spaces.
Files have been saved.
Access has been closed and table re-opened...

What am I missing?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:50
Joined
Aug 30, 2003
Messages
34,749
Presuming DefSidingTerms is the record source of the form, try just the field name in the control source of the textbox (no =):

DefSidingCrackMaj
 

Users who are viewing this thread

Top Bottom