Parameter query using control on a subform

  • Thread starter Thread starter Bill T.
  • Start date Start date
B

Bill T.

In Access 2000, I always just used [Forms]![FormName]!
[SubformName]![ControlName] to supply a parameter via a
control on a subform. I'm now attempting to run an Access
2000 database under Access 2003, and it appears this
doesn't work. Changing this to a "fully qualified"
reference (i.e. [Forms]![FormName]![SubformName].Form!
[ControlName]) DOES work, though. Do I really need to
adjust all my queries to make this run under Access 2003?
Or maybe I just need to add an extra library Reference?
If I need to "fix" the queries (100's of them), can I do
this via some sort of "find and replace"?

Thanks in advance.
-- Bill T.
P.S Access 2002 didn't have this problem.
 
The reference without the ".Form" part is always dicey, so it is better to
give the correct reference than to just hope Access will be able to resolve
it.

It is possible that this particular inconsistency between versions is due to
Name AutoCorrect. You could try turning that off under Tools | Options |
General, and then compact the database, but I would not expect it to fix the
problem.

You could ask Access to help you find all the queries that need changing,
but I don't know how you would go with trying to modify them
programmatically. Try this query:

SELECT MSysObjects.Name FROM MSysQueries INNER JOIN
MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id
WHERE MSysQueries.Expression Like "*Forms*";
 
Allen,
Thanks for the response. The "Name AutoCorrect" option
was already turned Off. (It may be a great feature, but
somehow I fear it's power, so I never use it.) I'll use
your query, though, to find all the places that my queries
will need to be updated. Thank you. (So much for default
collections.)
-- Bill

-----Original Message-----
The reference without the ".Form" part is always dicey, so it is better to
give the correct reference than to just hope Access will be able to resolve
it.

It is possible that this particular inconsistency between versions is due to
Name AutoCorrect. You could try turning that off under Tools | Options |
General, and then compact the database, but I would not expect it to fix the
problem.

You could ask Access to help you find all the queries that need changing,
but I don't know how you would go with trying to modify them
programmatically. Try this query:

SELECT MSysObjects.Name FROM MSysQueries INNER JOIN
MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id
WHERE MSysQueries.Expression Like "*Forms*";

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

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

In Access 2000, I always just used [Forms]![FormName]!
[SubformName]![ControlName] to supply a parameter via a
control on a subform. I'm now attempting to run an Access
2000 database under Access 2003, and it appears this
doesn't work. Changing this to a "fully qualified"
reference (i.e. [Forms]![FormName]![SubformName].Form!
[ControlName]) DOES work, though. Do I really need to
adjust all my queries to make this run under Access 2003?
Or maybe I just need to add an extra library Reference?
If I need to "fix" the queries (100's of them), can I do
this via some sort of "find and replace"?

Thanks in advance.
-- Bill T.
P.S Access 2002 didn't have this problem.


.
 
Back
Top