PC Review


Reply
Thread Tools Rate Thread

Building SQL Statement from Listbox

 
 
mattieflo
Guest
Posts: n/a
 
      11th Jul 2008
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!
 
Reply With Quote
 
 
 
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      13th Jul 2008
On Jul 11, 10:47*am, mattieflo <mattie...@discussions.microsoft.com>
wrote:
> 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?
 
Reply With Quote
 
mattieflo
Guest
Posts: n/a
 
      14th Jul 2008
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.

"(E-Mail Removed)" wrote:

> On Jul 11, 10:47 am, mattieflo <mattie...@discussions.microsoft.com>
> wrote:
> > 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!

>
> 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?
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      14th Jul 2008
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
http://I.Am/DougSteele
(no e-mails, please!)


<(E-Mail Removed)> wrote in message
news:6f6cab56-b4f4-4b76-a725-(E-Mail Removed)...
On Jul 11, 10:47 am, mattieflo <mattie...@discussions.microsoft.com>
wrote:

Hmm... where is Dev these days?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help building a SQL Statement jamesburkett@gmail.com Microsoft Access Queries 4 9th Aug 2006 09:49 PM
Re: building a SQL statement bala Microsoft Access Form Coding 1 3rd Aug 2003 02:28 PM
Re: building a SQL statement bala Microsoft Access Queries 1 3rd Aug 2003 02:28 PM
Re: building a SQL statement Newbie Microsoft Access Form Coding 2 1st Aug 2003 03:48 PM
Re: building a SQL statement Glen Appleton Microsoft Access Form Coding 0 28th Jul 2003 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:52 AM.