Why would I get a #Name? error for a bound textbox control on a form

ShovelinFishHeads

Registered User.
Local time
Today, 14:46
Joined
Aug 4, 2016
Messages
57
Why would I get a #Name? error produced by a bound textbox control on a form?

I am using the result set of a query to drive a form set to be viewed as a datasheet. The query results have no errors of any kind. When I put a certain textbox on the form, whether I use the form wizard, or by starting with a blank form, the textbox produces the #Name? error. Access is hinting at a problem with the field not being in the field list which is a little odd since the wizard had it in the field list when I used the form wizard to produce the form.

In the query, the field is producing exactly what it should.

So I don't get this. Could someone give me some guidance on what could be going wrong here?

Thanks everyone
 
It can be due to disambiguated names of the fields where the recordsource query has two fields of the same name from different tables.

eg table1.field1 and table2.field1

The names in the controlsource need to square brackets right around the whole name:
[table1.field1] and [table2.field1]
 
I figured out that when making the form for some reason Access was putting an extra company name into the control source like this:

Client.[CompanyName].[CompanyName]

When I took out the second instance of this in the textbox while in design view, the error was corrected. Wish I knew why it did this. I suppose it might be a symptom of really bad query design on my part. Oh well......
 

Users who are viewing this thread

Back
Top Bottom