#name? - Access 2007 - subform

R

Rick A

On a subform I'm receiving a #name? error in Access 2007.

I have a form/subform that is displayed on a tab in another form.
Yes a form with a tab control that has a form/subform combination.
When I display the form/subform outside of the tab it works, no
#name? on the subform. When I display the same form/subform inside
the tab I see #name?. All this is in Access 2007. Everything works
just fine in Access 2000, 2002, and 2003.

I took my Access 2000 base code to Access 2007. I opened the subform
in question and the record source was gone. Why I have no idea.
It shows fine in Access 2000. Anyway I put it back.

But that did not solve the problem.

I'm convinced it's a feature/bug in Access 2007.

Does anyone have any ideas? Has anyone run into this?

Rick
 
A

Allen Browne

It may help to know what's in the Control Source of the text box that yields
#Name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

On a subform I'm receiving a #name? error in Access 2007.

I have a form/subform that is displayed on a tab in another form.
Yes a form with a tab control that has a form/subform combination.
When I display the form/subform outside of the tab it works, no
#name? on the subform. When I display the same form/subform inside
the tab I see #name?. All this is in Access 2007. Everything works
just fine in Access 2000, 2002, and 2003.

I took my Access 2000 base code to Access 2007. I opened the subform
in question and the record source was gone. Why I have no idea.
It shows fine in Access 2000. Anyway I put it back.

But that did not solve the problem.

I'm convinced it's a feature/bug in Access 2007.

Does anyone have any ideas? Has anyone run into this?

Rick
 
R

Rick A

The form is based on a table called tblDog and the subform is based on a
table called trelDogRegistration. From a data modeling it's a classic 1 to
many construct.

The fields that show the #name? are all from the trelDogRegistration table.
The Control Source is the field name directly from the table.

The form in question is used two ways
1) as a stand alone form.
2) as a subform

When used as a stand alone form the subform displays correctly. In other
words there is data, no #name?.
When used as a subform the subform displays with the #name?.

The link fields for the subform are
link child fields = DogID;organizationcd
link master fields = DogID;txtorganizationcd

I use a field off of the form for this because the table tblDog does not
contain the organization code.

When the form is a subform the link fields are the same for the subform. I
do not do anything in code that changes the links. The links for the form
when it is a subform are:
link child fields = DogID
link master fields = txtDogID

Does this make sense?

I know if I were reading this I would get lost quickly because there is a
lot of details and I would blow this off. Way too much thinking involved.

Bottom line for me, there's something wrong with Access 2007 and nested
subforms. Again, this works in Access 2000, 2002, and 2003.

Does anyone have any issues with nested subforms in Access 2007?

Rick
 
A

Allen Browne

As you say, that's all very standard.

There's a couple of things that A2007 does oddly.
One is that it fails on an expression such as:
=[Form].[RecordsetClone].[RecordCount]
If you have any controls on the form that contain an expression (starts with
"="), try deleting those controls temporarily. (There's a situation where
Access quits trying to calcluate controls once one fails. That's why it's
important to delete all calculated controls to eliminate this possibility.)

There is also an issue where the AccessField type can confuse Access. If any
of the names in LinkChildFields or LinkMasterFields is not a control name,
clear the properties, add a text box for that control, save, and then set
the LinkChildFields/LinkMasterFields properties to the name of the control.

Turning off Name AutoCorrect may help also:
Office Button | Access Options | Current Database | Name AutoCorrect

As you are switching versions, it may help to compact, decompile, and
compact again.

You say the form is bound directly to the table, so it cannot be a cyclical
reference to something in a query.

Presumably your References are all okay.

You might also clear any input mask, format, and default value from the
control on the form and also from the field in the table, to eliminate that
possibility also.

Hopefully something there leads you in a useful direction.
 
A

Allen Browne

Another possibility is if the Name property of the text box is the same as
the name of something else.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Allen Browne said:
As you say, that's all very standard.

There's a couple of things that A2007 does oddly.
One is that it fails on an expression such as:
=[Form].[RecordsetClone].[RecordCount]
If you have any controls on the form that contain an expression (starts
with "="), try deleting those controls temporarily. (There's a situation
where Access quits trying to calcluate controls once one fails. That's why
it's important to delete all calculated controls to eliminate this
possibility.)

There is also an issue where the AccessField type can confuse Access. If
any of the names in LinkChildFields or LinkMasterFields is not a control
name, clear the properties, add a text box for that control, save, and
then set the LinkChildFields/LinkMasterFields properties to the name of
the control.

Turning off Name AutoCorrect may help also:
Office Button | Access Options | Current Database | Name AutoCorrect

As you are switching versions, it may help to compact, decompile, and
compact again.

You say the form is bound directly to the table, so it cannot be a
cyclical reference to something in a query.

Presumably your References are all okay.

You might also clear any input mask, format, and default value from the
control on the form and also from the field in the table, to eliminate
that possibility also.

Hopefully something there leads you in a useful direction.

Rick A said:
The form is based on a table called tblDog and the subform is based on a
table called trelDogRegistration. From a data modeling it's a classic 1
to many construct.

The fields that show the #name? are all from the trelDogRegistration
table. The Control Source is the field name directly from the table.

The form in question is used two ways
1) as a stand alone form.
2) as a subform

When used as a stand alone form the subform displays correctly. In other
words there is data, no #name?.
When used as a subform the subform displays with the #name?.

The link fields for the subform are
link child fields = DogID;organizationcd
link master fields = DogID;txtorganizationcd

I use a field off of the form for this because the table tblDog does not
contain the organization code.

When the form is a subform the link fields are the same for the subform.
I do not do anything in code that changes the links. The links for the
form when it is a subform are:
link child fields = DogID
link master fields = txtDogID

Does this make sense?

I know if I were reading this I would get lost quickly because there is a
lot of details and I would blow this off. Way too much thinking
involved.

Bottom line for me, there's something wrong with Access 2007 and nested
subforms. Again, this works in Access 2000, 2002, and 2003.

Does anyone have any issues with nested subforms in Access 2007?

Rick
 
R

Rick A

Thanks Allen.

I'll look into all of the suggestions you provided.

Rick

Allen Browne said:
As you say, that's all very standard.

There's a couple of things that A2007 does oddly.
One is that it fails on an expression such as:
=[Form].[RecordsetClone].[RecordCount]
If you have any controls on the form that contain an expression (starts
with "="), try deleting those controls temporarily. (There's a situation
where Access quits trying to calcluate controls once one fails. That's why
it's important to delete all calculated controls to eliminate this
possibility.)

There is also an issue where the AccessField type can confuse Access. If
any of the names in LinkChildFields or LinkMasterFields is not a control
name, clear the properties, add a text box for that control, save, and
then set the LinkChildFields/LinkMasterFields properties to the name of
the control.

Turning off Name AutoCorrect may help also:
Office Button | Access Options | Current Database | Name AutoCorrect

As you are switching versions, it may help to compact, decompile, and
compact again.

You say the form is bound directly to the table, so it cannot be a
cyclical reference to something in a query.

Presumably your References are all okay.

You might also clear any input mask, format, and default value from the
control on the form and also from the field in the table, to eliminate
that possibility also.

Hopefully something there leads you in a useful direction.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Rick A said:
The form is based on a table called tblDog and the subform is based on a
table called trelDogRegistration. From a data modeling it's a classic 1
to many construct.

The fields that show the #name? are all from the trelDogRegistration
table. The Control Source is the field name directly from the table.

The form in question is used two ways
1) as a stand alone form.
2) as a subform

When used as a stand alone form the subform displays correctly. In other
words there is data, no #name?.
When used as a subform the subform displays with the #name?.

The link fields for the subform are
link child fields = DogID;organizationcd
link master fields = DogID;txtorganizationcd

I use a field off of the form for this because the table tblDog does not
contain the organization code.

When the form is a subform the link fields are the same for the subform.
I do not do anything in code that changes the links. The links for the
form when it is a subform are:
link child fields = DogID
link master fields = txtDogID

Does this make sense?

I know if I were reading this I would get lost quickly because there is a
lot of details and I would blow this off. Way too much thinking
involved.

Bottom line for me, there's something wrong with Access 2007 and nested
subforms. Again, this works in Access 2000, 2002, and 2003.

Does anyone have any issues with nested subforms in Access 2007?

Rick
 

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