Object doesn't support this property or method

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.
 
K

Ken Snell \(MVP\)

Try this:

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

Guest

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?
 
M

Marshall Barton

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?
 
G

Guest

I don't think that's possible. as mentioned above, the name automatically
fills in after 'me.' but thanks for the thought
 
K

Ken Snell \(MVP\)

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.
 
G

Guest

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
 

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