Building SQL Statement from Listbox

M

mattieflo

Hello,

I have a form with two listboxes. What happens is the user selects fields
from the first listbox and they land in the second listbox. What I want is to
create an Excel Report that populates with the fields the users selected. To
do this, I need to build a dynamic SQL statement based on what the user
selected. Further complicating this is that the fields are taken from
multiple tables so I also have to build a join statement as well. Has anyone
ever done something like this and do they have an example they could show me?
Thanks!
 
P

pietlinden

Hello,

I have a form with two listboxes. What happens is the user selects fields
from the first listbox and they land in the second listbox. What I want is to
create an Excel Report that populates with the fields the users selected.To
do this, I need to build a dynamic SQL statement based on what the user
selected. Further complicating this is that the fields are taken from
multiple tables so I also have to build a join statement as well. Has anyone
ever done something like this and do they have an example they could showme?
Thanks!

Dev answered this a loooong time ago... and people asked it so often
that he put it on his website...

http://www.mvps.org/access/forms/frm0007.htm

Hmm... where is Dev these days?
 
M

mattieflo

Hey pietlinden,

I think I figured out how to do this for one field, what i'm looking for is
a listbox that has different fields located in it. When you pick out a field,
that's the particular field that will get exported to excel. The Select part
is the easy part for this, the hard part for me is writing the WHERE clause
that represents the joins and I was wondering if there was an example out
there for this...

Thanks for your time btw.
 
D

Douglas J. Steele

Dev's alive and well, living in New Jersey and working in New York City.

He just doesn't do much with Access anymore, so he doesn't hang out here
anymore. (he's still got some involvement with the website, though)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


On Jul 11, 10:47 am, mattieflo <[email protected]>
wrote:

Hmm... where is Dev these days?
 

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