#name? error in Form control

J

jhawk

I've created a form with simple text box controls that retrieve data from a
Count query based on another query, but each control that uses this process
shows a #name? error. I've tried all the steps suggested on the Microsoft
support site to resolve the issue, but the error messages remain:

-all expressions created using the Expression Builder are preceded by "="
with no spaces
-all the file names referenced are correct and no typos are present.

If anyone has an idea how I can resolve this problem, I would be very
grateful.
 
G

golfinray

#name means there is no record there or null. Try to exclude nulls in your
query using something like Is Not Null. Also check the recordsource of your
form and and textboxes and make sure they are connected to where you think
they are connected.
 
B

BruceM

Is the query that includes Count the form's Record Source? If so, does the
query run properly by itself?
 
J

jhawk

The query that acts as the Record Source for the form is indeed the one that
uses the Count function. I've run that query alone, and it seems to work
fine.

Additionally, as golfinray suggested, I checked to make sure there were no
null values that were part of the original query record source and even
included the criterium "Is Not Null". Alas, this still has not solved the
problem.

Any other ideas?
 
B

BruceM

That wasn't an idea, it was information-gathering. If the query works and
you get the #Name error it probably means the form does not recognize the
query fields. Is the query the Record source for the form, and are the
controls (e.g. text boxes) on the form bound to fields in that Record
Source? That is, have you selected the field from the drop-down list of
fields available for the text box Control Source?
 
J

jhawk

The query is the Record Source for the form controls (i.e., text boxes). The
text box controls are linked to the query through an expression I created
using the Expression Builder. All elements of the expression were pulled
directly from the Expression Builder's drop-down menus, as shown below:

=[qrySystemHazardCount]![SystemHazardCount]
 
B

BruceM

A form or report has a Record Source. Controls such as text boxes have a
Control Source.

Why not just make qrySystemHazardCount the Record Source for the form, and
bind text boxes to the query fields? You seem to be taking the long way
around. Part of the problem is that the expression does not specify a
particular record. In your example, from which record would you have Access
select the SystemHazardCount field?

jhawk said:
The query is the Record Source for the form controls (i.e., text boxes).
The
text box controls are linked to the query through an expression I created
using the Expression Builder. All elements of the expression were pulled
directly from the Expression Builder's drop-down menus, as shown below:

=[qrySystemHazardCount]![SystemHazardCount]

BruceM said:
That wasn't an idea, it was information-gathering. If the query works
and
you get the #Name error it probably means the form does not recognize the
query fields. Is the query the Record source for the form, and are the
controls (e.g. text boxes) on the form bound to fields in that Record
Source? That is, have you selected the field from the drop-down list of
fields available for the text box Control Source?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top