Show only queries w/table source combo box

B

Billy B

Is it possible to display only query names in a combo box where the queries
source contains the table [Mstr List]?

Thank you very much for any help.
 
T

Tom van Stiphout

On Thu, 3 Jun 2010 05:13:46 -0700, Billy B

To do that you would have to write some VBA code to iterate over the
Querydefs collection, inspect the SQL property of each Querydef
object, and add the ones you like to the dropdown. Here is an
off-the-cuff example. You would put this code in the Form_Load event:
dim qd as dao.querydef
for each qd in currentdb.querydefs
if instr(qd.sql, "[Mstr List]") > 0 then
myCombobox.AddItem qd.name
end if
next

-Tom.
Microsoft Access MVP
 

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