SELECT FROM function in Access 2000

P

Paolo Bormida

Hi all,

any idea how to create a function returning a recordset to be used in
a FROM clause of a SELECT?

I explain better.

I would like to write a function (in a VBA Module) that builds up a
resultset, then that resultset must be query-able again with a select.

Is that possible in Access 2000 ? In any newer version?

TIA

Paolo
 
R

Roger Carlson

There is a seriously weird, undocumented format for using a subquery in the
From clause - essentially as another table. It won't work if you have spaces
or special characters in the names of tables or fields (which I don't like
anyway). The syntax is:

[insert your query here]. As SomeAlias

The left and right square brackets are required, the dot after the right
bracket is required, and the As and alias are required. You can't do
ANYTHING that would require the use of square brackets, inside
the square brackets - that's why no spaces or special characters in names.
 

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