Solved

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

Posted on 2014-01-21
8
1,550 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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

705 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

18 Experts available now in Live!

Get 1:1 Help Now