Object doesn't support this property or method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform 'TestSubform' on a tabcontrol. I have a form call setup on a
hyperlink. The onclick method runs a query which calls for a field on the
subform 'TestID'.

docmd.runsql "FormQuery '" & me.testsubform.form!TestID & "'"

I have other forms setup this way and they work. This one says the object
doesn't support this property or method.??? I am confused. I've even copied
code from the working calls and changed the names but to no avail.
 
Made requested changes and I receive the same error. The form name does show
up when building the statement and I have verified the field name?
 
Dazzle said:
I have a subform 'TestSubform' on a tabcontrol. I have a form call setup on a
hyperlink. The onclick method runs a query which calls for a field on the
subform 'TestID'.

docmd.runsql "FormQuery '" & me.testsubform.form!TestID & "'"

I have other forms setup this way and they work. This one says the object
doesn't support this property or method.??? I am confused. I've even copied
code from the working calls and changed the names but to no avail.


Is it possible that the name of the subform **control** on
the main form is not named testsubform?
 
I don't think that's possible. as mentioned above, the name automatically
fills in after 'me.' but thanks for the thought
 
Is the query whose name is being "established" by the concatenation of the
"FormQuery " and the '-delimited string from TestID field actually an action
query? Methinks that you're trying to run a query that (a) doesn't exist;
or (b) is not an action query.
 
I know this topic is old but I had a very similar situation and searching the
groups brought up this topic first.

The answer could have to do with having the AutoCorrect name option turned
on. I did and my problems started right after I changed the name of a
control on my table. Thanks to this group, the search function and a little
bit of reading I found my problem.

Just for future reference. :)

Lauri
 
Back
Top