DoCmd.OpenQuery sometimes open the qry... sometimes not... why?

  • Thread starter tonteria via AccessMonster.com
  • Start date
T

tonteria via AccessMonster.com

Hi everyone if you can help me with this I would be very grateful.

When I need to run a query I usually use those lines of code in my forms:

DoCmd.OpenQuery "qry_myqry", acViewNormal, acReadOnly

It run the qry but do not open it.
But now in another form the same code open the qry...
I do not understand.
Why in some form the qry is not open and in another one is open?

I do not want to open the qry. And I do not want to use a "DoCmd.RunSQL"
code
I know that I can close the qry once it has been opened using the following
code:

DoCmd.Close acQuery, "qry_myqry", acSaveNo

But I would like not to open and know the reason why sometimes it is open and
sometime not....

Thanks in advance!
And regards from Spain!
JJ
 
Top