Referencing a table from VBA

G

Guest

Not sure this is the right place for this question again ... however I am
very Stuck!

I have a Form that makes calls to several SQL statements through VBA, The
Module is getting somewhat untidy and I was seeking a way to reference a
SQLQuery Table (that I have created) that I could call in the SQL statements
From ??

Thus instead of having lengthy cumbersome SQL statements ... SELECT * FROM etc
I could reference the table identifier and lift the SQL text ???

The table has currently three colums QryNo (Integer), QryName(String) and
QryText(Memo[due to length of some of the queries])

Can anyone point me in the right direction for the VBA code to lookup this
table Using either QryNo or QryName and return the QryText

Any pointers gratefully appreciated
 
G

Guest

Please Cancel ... I will read my books more thoroughly

I have used DLookup("[QryText]", "tblQry", "[QryName] = 'xyz'"

Many Thanks in anycase

Regards
 

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