Solved

Ms Access bound textbox returns #name? and checkbox is "bound to unknown field"

Posted on 2014-01-21
8
1,585 Views
Last Modified: 2014-01-27
I'm using a form bound to a query that selects from one table. I added a short date formatted text box and a checkbox to the form after updating the table, then the query (selecting from the field list), and checking that data in the table was returned and could be edited.

Both new controls are giving problems. The textbox returns #Name? and the checkbox reports that its bound to an unknown field. I'd happily believe that - except that in both cases, the controlsource properties were selected from the list of available fields. The field the checkbox reports has the correct name.

If I change the bound names to other fields from the query with apparently identical definitions, they work properly. Its only when I use the new fields that I have an issue. I've used Access for a long time but haven't come across anything like this before - any ideas, please?
0
Comment
Question by:MikeDiggins
8 Comments
 
LVL 3

Expert Comment

by:Sreeram
ID: 39799101
Hi

   you need to create a dummy column for the text box and checkbox in the record source query or remove the control source of that control.

Thanks
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 39799156
Could be corruption. Backup your entire and them compact it. If that doesn't work try removing the controls, then close and reopen the snow, then add the controls back.
0
 
LVL 21
ID: 39799195
Try changing the control name to have a txt (for textbox) and chk (for checkbox) prefixes. This will make sure there are not any name conflicts between contrtols and fields confusing Access.
0
 

Author Comment

by:MikeDiggins
ID: 39799524
Thanks, all
Scott, we have had some corruption before on the codebase so I'll try that. Coach, good point, should have mentioned I'm already doing that, as well as making sure "Date" columns don't start with "date".
kujumbio, I'm not quite with you. The query is already drawing those fields from the database and I can see them as options in the dropdown list when allocating the controlsource property. I know the literature has misspelt (probably through being typed in) column names as the usual cause but that's not the case here. Am I missing something by your reference to dummy columns, I wonder?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 84
ID: 39799688
kujumbio, I'm not quite with you.
I didn't understand that advice either.  You don't need "dummy" columns, you're working with the columns defined on your table.

Also, sorry about my somewhat inane posting earlier. I was doing this from my Kindle and obviously auto-correct struck!!
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 39800365
The most common reason for that error is using a column name from the RecordSource as the Name property of a control that is not bound to the column.  When you use the wizard to build a form or when you drag fields from the field list, Access automatically assigns the field name as the Name property of the control.  If you later change the control to bind it to some other field or even make it unbound, you will see the #name? error.

If changing the Name property so that it doesn't conflict with existing names doesn't resolve the error, the problem could be corruption.  Delete the control from the form.  Save it.  Compact the database.  Then reopen the form and add the control back.

As someone has already mentioned, best practice is to change all the Name properties by adding a prefix such as txt, chk, cbo, etc.  This has the advantage in code of allowing you to distinguish between referencing the control itself and the bound field.
0
 

Author Comment

by:MikeDiggins
ID: 39813477
No worries, Scott - knew what you meant.
Thanks everyone, this turned out to be an unusual way of reporting corruption. I was able to use the SaveAsText function folllowed by LoadFromText into a new database, then imported the result. Still going to rebuild the database into a new one, though - corruption seems to continue until you do that. Or maybe I'll just rebuild into something other than Access!
0
 

Author Closing Comment

by:MikeDiggins
ID: 39813484
THnaks for the clear explanations; they gave plenty to think about whether or not they were the answer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now