Microsoft office access can't find the object 'qrySummery' (1 Viewer)

NimBus87

Registered User.
Local time
Today, 08:41
Joined
Apr 21, 2010
Messages
14
Microsoft office access can't find the object 'qrySummary'

Hi all,

I have an Access application that has SQL Server as front-end database.
i created a view called"qrySummery" in SQL, in access i wanted to show the results from this qry by clicking a button in a form, so in the vb i had the code as follow:

DoCmd.OpenQuery "qrySummery"

Every time i try to run it, it returns an error msg saying:
"Microsoft office access can't find the object 'qrySummery'.
Even though, when i run the qry from the queries tab it works perfectly.

Thanks and looking forward to hearing from you
 
Last edited:

boblarson

Smeghead
Local time
Today, 08:41
Joined
Jan 12, 2001
Messages
32,059
Is this an ADP or an Access database with LINKED SQL Server tables?
 

NimBus87

Registered User.
Local time
Today, 08:41
Joined
Apr 21, 2010
Messages
14
yape, this is an ADP database,, sorry forgot to mention this
 

boblarson

Smeghead
Local time
Today, 08:41
Joined
Jan 12, 2001
Messages
32,059
Sorry, but I don't use ADPs (prefer linked tables to SQL Server instead). But, it shouldn't be DoCmd.OpenQuery but DoCmd.OpenView (but I couldn't get it working on my machine).
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:41
Joined
Sep 12, 2006
Messages
15,651
is it really called summery, and not summary?

that might be the problem
 

boblarson

Smeghead
Local time
Today, 08:41
Joined
Jan 12, 2001
Messages
32,059
I was thinking the same too Dave.

Have either of you (Dave or vbaInet) opened a SQL View in an ADP using code? I tried the same thing that the OP did and it gave me the same error even if I copied and pasted the name in. So, I don't think it has to do with that, but that it is an ADP and that there are things you cannot do like you would with a linked SQL Server source.
 

vbaInet

AWF VIP
Local time
Today, 16:41
Joined
Jan 22, 2010
Messages
26,374
Have either of you (Dave or vbaInet) opened a SQL View in an ADP using code? I tried the same thing that the OP did and it gave me the same error even if I copied and pasted the name in. So, I don't think it has to do with that, but that it is an ADP and that there are things you cannot do like you would with a linked SQL Server source.
I was just questioning the "possibility" of a typo in the spelling. Not criticising your proposition Bob ;)
 

boblarson

Smeghead
Local time
Today, 08:41
Joined
Jan 12, 2001
Messages
32,059
I was just questioning the "possibility" of a typo in the spelling. Not criticising your proposition Bob ;)

And I was just letting you both know that it doesn't matter if the name is right or wrong - the result is the same. :D
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 16:41
Joined
Sep 12, 2006
Messages
15,651
Bob

all i thought was that if the command said

DoCmd.OpenQuery "qrySummery"

but the actual query was called

qrySummary

then it WOULD report that the query could not be found.

---------------
But based on your comments, this is probably a red herring

Having said all this, I dont use ADP's so I guess I cant help any.
 

NimBus87

Registered User.
Local time
Today, 08:41
Joined
Apr 21, 2010
Messages
14
Hi All,

i am sorry about the typo, but it was not the problem,, i kind of figured it out about 5 min ago :cool: ,, all what I had to do is add “dbo.” Before the qry name, so something like the following:

DoCmd.OpenView "dbo.qrySummary", acViewNormal, acEdit

Anyway, I want to thank you all for the contribution :)
 

boblarson

Smeghead
Local time
Today, 08:41
Joined
Jan 12, 2001
Messages
32,059
Hi All,

i am sorry about the typo, but it was not the problem,, i kind of figured it out about 5 min ago :cool: ,, all what I had to do is add “dbo.” Before the qry name, so something like the following:

DoCmd.OpenView "dbo.qrySummary", acViewNormal, acEdit

Anyway, I want to thank you all for the contribution :)

Hmm, interesting as that hadn't worked with my objects. :( So I never offered up the suggestion. I'll have to double check that I tried that.
 

Users who are viewing this thread

Top Bottom