Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / July 2008

Tip: Looking for answers? Try searching our database.

Passing value to Query Criteria from ListBox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Atif - 15 Jul 2008 21:24 GMT
Hi.

In Access 2007 how can we  pass  values from a Listbox to a Query as criteria.

presently I am using a Command Button to call a Macro which displays Query
in Povit Chart View. I want to you a ListBox insted Command button so user
can filtered data.

Thanks
Jeff Boyce - 16 Jul 2008 00:23 GMT
You don't need to!

You can modify your query to look for a value selected in a listbox on an
open form.  This assumes you are only using a single selection as your
criterion.

In your SelectionCriterion property, you'd use something like:

   Forms!YourFormName!lstYourListboxName

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hi.
>
[quoted text clipped - 6 lines]
>
> Thanks
Atif - 16 Jul 2008 14:31 GMT
Hi Jeff:

I am calling the same Macro throug List box and my Criteria is:
[Forms]![Switchboard]![List82]
I am receving Error, Database Engin does not recognized
[Forms]![Switchboard]![List82] as valid field name or expression.

Whats wrong?

Atif

> You don't need to!
>
[quoted text clipped - 21 lines]
> >
> > Thanks
Jeff Boyce - 16 Jul 2008 18:30 GMT
Access is very picky about spelling.  Are you certain the name of the form
and the name of the control are both spelled exactly?

Have you used the "builder" feature in the query to simply "point" to the
correct control/form?

Is the form open when you run the query?

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hi Jeff:
>
[quoted text clipped - 34 lines]
>> >
>> > Thanks
Atif - 16 Jul 2008 19:59 GMT
Hi Jeff:

the spelling are correct and I used builder feature as well, still "Enging
not able to recognized the refered objects.

Atif

> Access is very picky about spelling.  Are you certain the name of the form
> and the name of the control are both spelled exactly?
[quoted text clipped - 47 lines]
> >> >
> >> > Thanks
Jeff Boyce - 16 Jul 2008 21:58 GMT
Atif

Sorry, but I haven't run across that particular situation.  Have you tried
searching on-line for the error message you are receiving?

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hi Jeff:
>
[quoted text clipped - 57 lines]
>> >> >
>> >> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.