Access open query

  • Thread starter hansi13 via AccessMonster.com
  • Start date
H

hansi13 via AccessMonster.com

Hello,

probably a stupid question but is there a way to access a open query. E. g.
user runs a query and vba accesses the displayed result? (so vba is not
opening the query).

thanks a lot in advance,
hansi
 
K

Ken Snell MVP

No. You'd need to open a recordset that uses the same SQL statement to
generate the records as did the query that the user opened.
 
D

Douglas J. Steele

Or, for a simple query that returns just one row, you could use DLookup.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Ken Snell MVP said:
No. You'd need to open a recordset that uses the same SQL statement to
generate the records as did the query that the user opened.
 
D

David H

What are you trying to accomplish?

(As the Shadows would say 'What do you want?' - I've been watching Babylon 5)
 
H

hansi13 via AccessMonster.com

Hey,

first of all: Thanks for the replies, will check them now.
I was thinking about: User open a query with some parameter, result is
displayed, user presses a button and the displayed result is the input
(recordset) for a sub.


I was hoping that there is s. th. like a collection e. g. "openqueries". I
can handle surely by opening the query by vba saving the result directly as
recordset.

BR,
Hansi

David said:
What are you trying to accomplish?

(As the Shadows would say 'What do you want?' - I've been watching Babylon 5)
[quoted text clipped - 4 lines]
thanks a lot in advance,
hansi
 
Top