Solved

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

Posted on 2014-01-21
8
1,705 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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
 
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 36

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

756 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