What's in a #NAME?

O

owp^3

I struggled with this for several hours and finally figured it out. I
couldn't find the answer in this forum so I wanted to share it.

I have a form with several comboboxes. All of the comboboxes worked except
one. The one that didn't work kept saying #NAME?

The only difference between that combo and the others was the Control
Source. Control Sources that worked were just the fieldnames from the query.
The one that didn't was queryname.fieldname. If I removed the "queryname."
leaving just the fieldname then I got a "3265 not found in collection" error.
When I tried to use the Control Source dropdown in the Propoerties dialog
fieldname was not an option. In fact I had two queryname.fieldname options
to choose from... hmmm...

Adding to the complication, the form was actually one of three subforms and
the main form changed the recordsources of the subforms between three sets of
four queries. All queries had the same structure and field names. The only
difference between each set of queries was the datasource. Within each set of
queries was an underlying query and three filtered queries. Each filtered
query populated one subform.

Since all of the fields in all of the queries were the same I used the "*"
to pull all of the fields into the filtered queries. Therein lies the
problem. You can't filter on a "*" field so you add the specific field you
want to filter on. Thus you have two columns in the query builder one
containing all the fields and then a second containing a DUPLICATE of a field
in the "*" column. Access, when you double click on a field in the
table/query list adds it to the query design with the SHOW box checked. With
the SHOW box checked the form throught there were two fields with the same
name from the same query and couldn't resolve either of them; hence the two
queryname.fieldname choices in the Control Source dropdown.

Once I unchecked the SHOW box I could use just fieldname as the Control
Source and everything worked just fine.

I hope this helps someone else down the road.

Thanks,

owp^3
 
Top