Getting SQL of RowSource

Shep

Shep
Local time
Today, 09:32
Joined
Dec 5, 2000
Messages
364
Is there a way to get the SQL of the RowSource of a ListBox when the RowSource = "(saved query name)", without enumerating the QueryDefs Collection to get the saved query's SQL?
 
Why enumerating the querydefs-collection?
You surely needs the querydef, but I think this will work:
Querydefs(MyListBox.Rowsource).SQL
(not yet tested, sorry ;))
 
Not to worry...that's what I'm here for!

Result: "Sub or Function not defined" (QueryDefs)

Perhaps I should mention I'm using Access 97...
 
eh....got it

dbs.QueryDefs...etc..

Many thanks, works like a charm :)

Shep
 

Users who are viewing this thread

Back
Top Bottom