By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

Help with SQL Query

P: n/a
I created a Multi Select list box.

I even got the code to create the SQL statement in a control called Item.
Forms!Form1!Item

Here is a sample of what appears in Item:
Select Name, activity from Table1 where [activity]=MA OR [Activity]=MW ;

I have a button called button1
Forms!Form1.Button1

What is the code that I have to attach to button1 to run the query????

Thanks,
AlanA
Ab*********@coned.com
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
What do you want to happen when you "run" the query? If you want to assign
it to the Row Source of the listbox, then the code would be placed in the
button's OnClick event procedure and look something like:

Me.lstNameOfListbox.RowSource = Forms!Form1!Item

Replace Me with Forms!NameOfForm if the code isn't running on the same form
as the listbox.

--
Wayne Morgan
"Alan" <mr**@mindspring.com> wrote in message
news:f8**************************@posting.google.c om...
I created a Multi Select list box.

I even got the code to create the SQL statement in a control called Item.
Forms!Form1!Item

Here is a sample of what appears in Item:
Select Name, activity from Table1 where [activity]=MA OR [Activity]=MW ;

I have a button called button1
Forms!Form1.Button1

What is the code that I have to attach to button1 to run the query????

Thanks,
AlanA
Ab*********@coned.com

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.