Solved

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

Posted on 2014-01-21
8
1,658 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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 35

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

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.

Question has a verified solution.

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

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

856 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