#Name? displayed in Text Box

G

Graham

The RecordSource for my form has been created using Query Builder.

When the form opens, this particular bound text box displays #Name?. In
have run the query from the Query Builder and there definitely is a value for
that field in the first record - but not necessarily in all records.

I've run out of ideas.
 
S

strive4peace

#Name -- Bound ControlSource must match Fieldname
---

Check the ControlSource property where you see the error -- from the
property sheet of the control, drop the list of available fields for the
ControlSource property and make sure you have spelled the fieldname
correctly

#Name means that you have made a reference to something Access can't
find (doesn't matter if data is not there unless ControlSource is an
equation -- but your error would be different)

~~~~ turn on Properties window ~~~~

When you are in the design view, turn on/off the Properties window -->

1. from menu: View, Properties
OR
2. right-click and choose Properties from the shortcut menu

and then click on various objects. The properties window changes as you
change what is selected. If you have multiple objects selected, the
values for the properties they have in common will be displayed


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Graham

Thanks Crystal

Forgot to mention Access 2002

I had originally used the drop-down list to select the ControlSource - just
gone back and re-done it with the same result.

The field name is AgeGrp1ID, is it possible that the digit in the Field Name
is a problem.

I have spent hours on this - so frustrating.
 
G

Graham

Thanks Tom
Forgot to mention Access 2002

Ckecked the KB and didn't find anything enlightening.

I had originally used the drop-down list to select the ControlSource - just
gone back and re-done it with the same result.

The field name is AgeGrp1ID, is it possible that the digit in the Field Name
is a problem.

Already spent hours on this - so frustrating.
 
S

strive4peace

Digits in fieldnames
---

Hi Graham

"I had originally used the drop-down list to select the ControlSource"
<clip>
"is it possible that the digit in the Field Name is a problem"

digits in names can cause strange happenings ... but I have not seen a
problem as a ControlSource -- unless it is only a problem after you try
to change the ControlSource through code...

I suspect, however, the problem may be deeper -- is this a calculated
field somewhere? What is the SQL for your query? Are you joining
tables with 1:M relationship?

Why does your fieldname have a digit? Digits in fieldnames are often an
indication that your database is not normalized.


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

Graham

Thanks Crystal

I accept your comment about normalization.

While my experience with Access is limited, I am an experienced A/P who
prides himself on normalized design except that there are times when
practicality overrides theory.

Enough of the sermon - I realleally appreciate everyones help on this forum.

The way this application needs to function, I can't see how to achieve
results without having the similarly named fields with numeric
differentiation.

The SQL for RecordSource is
SELECT tEnrolment.*, [tEnrolment.ParticipantFName] & " " &
[tEnrolment.ParticipantLName] AS Participant, [tMstrProgramName.Description]
& " : " & [StartDate] AS Program, tMstrCultural.Description AS Cultural,
tMstrMaritalStatus.Description AS Marital, tMstrStaff.FirstName & " " &
tMstrStaff.LastName AS Staff, tMstrProgram.AgeGrp1ID, tMstrProgram.AgeGrp2ID
FROM (((tEnrolment LEFT JOIN (tMstrProgram LEFT JOIN tMstrProgramName ON
tMstrProgram.ProgNameID = tMstrProgramName.ProgNameID) ON
tEnrolment.ProgramID = tMstrProgram.ProgramID) LEFT JOIN tMstrCultural ON
tEnrolment.CulturalID = tMstrCultural.CulturalID) LEFT JOIN
tMstrMaritalStatus ON tEnrolment.MaritalStatusID =
tMstrMaritalStatus.MaritalStatusID) LEFT JOIN tMstrStaff ON
tEnrolment.StaffID = tMstrStaff.StaffID;
 
S

strive4peace

hidden combobox trick
---

Hi Graham,

"practicality overrides theory"

I can relate to that

is this form used for input or just display?

One thing you have is a lot of LEFT JOINs... cannot you display
corresponding Names using the ole hidden combobox trick?

combobox:
Name --> ID_field
ControlSource --> ID_field
RowSource -->
SELECT ID_field, SomeName, field3
FROM Tablename
ORDER BY SomeName
Visible --> No (or Yes -- depends what you need)

now, you can make a calculated control for SomeName

controlSource --> =ID_field.column(1)

why do you have 2 age groups on this record instead of using a subform?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
T

Tom Wickerath

Hi Graham,
The field name is AgeGrp1ID, is it possible that the digit in the Field Name
is a problem.

No.

I just spent some time this morning creating all of the indicated tables,
and put some test data in. I created a query based on your SQL statement, and
then created a form based on this query. Everything works fine for me.

If you are willing to send me a compacted and preferably zipped copy of your
database, I will take a look at it for you. If interested, send me a private
e-mail message with a valid reply-to address. My e-mail address is available
at the bottom of the contributor's page indicated below.Please do not post
your e-mail address (or mine) to a newsgroup reply. Doing so will only
attract the unwanted attention of spammers.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
T

Tom Wickerath

PS. Although it is likely not the cause of your #Name error, I did notice
the use of reserved words in Access for some of your field names
(Description). My advice is to avoid using any reserved words for things that
you assign a name to. Here is a nice compiled list that Access MVP Allen
Browne has that you should consider bookmarking:

Problem names and reserved words in Access
http://allenbrowne.com/AppIssueBadWord.html

Allen has also created a free utility that you can download, to help
identify reserved words and other issues.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
 
G

Graham

Hi Crystal

It's morning in Oz and I have commitments until afternoon.

Then, I will try to digest your suggestion.

As I said, my Access experience is limited - probably best described as a
"hacker".
--
Graham


strive4peace said:
hidden combobox trick
---

Hi Graham,

"practicality overrides theory"

I can relate to that

is this form used for input or just display?

One thing you have is a lot of LEFT JOINs... cannot you display
corresponding Names using the ole hidden combobox trick?

combobox:
Name --> ID_field
ControlSource --> ID_field
RowSource -->
SELECT ID_field, SomeName, field3
FROM Tablename
ORDER BY SomeName
Visible --> No (or Yes -- depends what you need)

now, you can make a calculated control for SomeName

controlSource --> =ID_field.column(1)

why do you have 2 age groups on this record instead of using a subform?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Thanks Crystal

I accept your comment about normalization.

While my experience with Access is limited, I am an experienced A/P who
prides himself on normalized design except that there are times when
practicality overrides theory.

Enough of the sermon - I realleally appreciate everyones help on this forum.

The way this application needs to function, I can't see how to achieve
results without having the similarly named fields with numeric
differentiation.

The SQL for RecordSource is
SELECT tEnrolment.*, [tEnrolment.ParticipantFName] & " " &
[tEnrolment.ParticipantLName] AS Participant, [tMstrProgramName.Description]
& " : " & [StartDate] AS Program, tMstrCultural.Description AS Cultural,
tMstrMaritalStatus.Description AS Marital, tMstrStaff.FirstName & " " &
tMstrStaff.LastName AS Staff, tMstrProgram.AgeGrp1ID, tMstrProgram.AgeGrp2ID
FROM (((tEnrolment LEFT JOIN (tMstrProgram LEFT JOIN tMstrProgramName ON
tMstrProgram.ProgNameID = tMstrProgramName.ProgNameID) ON
tEnrolment.ProgramID = tMstrProgram.ProgramID) LEFT JOIN tMstrCultural ON
tEnrolment.CulturalID = tMstrCultural.CulturalID) LEFT JOIN
tMstrMaritalStatus ON tEnrolment.MaritalStatusID =
tMstrMaritalStatus.MaritalStatusID) LEFT JOIN tMstrStaff ON
tEnrolment.StaffID = tMstrStaff.StaffID;
 
G

Graham

Thanks Tom

I have commitments until this afternoon (morning here now) and will look at
things then.

Thanks for the tip about reserved words - had I been aware, I certainly
would not have used any.

Be in touch.
 
G

Graham

Hi Crystal

Sorry about the delay in getting back.

I've digested your combo-box approach and I'll be interested to have a play
with it.

Tom Wickerath came up with the solution to my problem - the form was linked
with code to a subform (data-sheet view) and the problem fields were not in
the SQL for the subform RecordSource.

Thanks


--
Graham


strive4peace said:
hidden combobox trick
---

Hi Graham,

"practicality overrides theory"

I can relate to that

is this form used for input or just display?

One thing you have is a lot of LEFT JOINs... cannot you display
corresponding Names using the ole hidden combobox trick?

combobox:
Name --> ID_field
ControlSource --> ID_field
RowSource -->
SELECT ID_field, SomeName, field3
FROM Tablename
ORDER BY SomeName
Visible --> No (or Yes -- depends what you need)

now, you can make a calculated control for SomeName

controlSource --> =ID_field.column(1)

why do you have 2 age groups on this record instead of using a subform?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Thanks Crystal

I accept your comment about normalization.

While my experience with Access is limited, I am an experienced A/P who
prides himself on normalized design except that there are times when
practicality overrides theory.

Enough of the sermon - I realleally appreciate everyones help on this forum.

The way this application needs to function, I can't see how to achieve
results without having the similarly named fields with numeric
differentiation.

The SQL for RecordSource is
SELECT tEnrolment.*, [tEnrolment.ParticipantFName] & " " &
[tEnrolment.ParticipantLName] AS Participant, [tMstrProgramName.Description]
& " : " & [StartDate] AS Program, tMstrCultural.Description AS Cultural,
tMstrMaritalStatus.Description AS Marital, tMstrStaff.FirstName & " " &
tMstrStaff.LastName AS Staff, tMstrProgram.AgeGrp1ID, tMstrProgram.AgeGrp2ID
FROM (((tEnrolment LEFT JOIN (tMstrProgram LEFT JOIN tMstrProgramName ON
tMstrProgram.ProgNameID = tMstrProgramName.ProgNameID) ON
tEnrolment.ProgramID = tMstrProgram.ProgramID) LEFT JOIN tMstrCultural ON
tEnrolment.CulturalID = tMstrCultural.CulturalID) LEFT JOIN
tMstrMaritalStatus ON tEnrolment.MaritalStatusID =
tMstrMaritalStatus.MaritalStatusID) LEFT JOIN tMstrStaff ON
tEnrolment.StaffID = tMstrStaff.StaffID;
 
S

strive4peace

Hi Graham,

glad Tom found the problem ;) happy to help

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Top