If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Passing value to Query Criteria from a ListBox
I am using Access 2007.
Presently I am using a Command Button to call a Macro which opens a Query in Pivot Chart view. Now I want to use a ListBox which has these options NAE, NAW and EU. How can I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. |
#2
|
|||
|
|||
Passing value to Query Criteria from a ListBox
Make the criteria for that field equal to the listbox.
=forms!whatform.listbox Run the query from an event of the listbox. Bonnie http://www.dataplus-svc.com Atif wrote: I am using Access 2007. Presently I am using a Command Button to call a Macro which opens a Query in Pivot Chart view. Now I want to use a ListBox which has these options NAE, NAW and EU. How can I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Passing value to Query Criteria from a ListBox
Thanks:
I am using following criteria =[Forms]![Switchboard]![ListSalesRegion.Column(0)] it give error: Microsoft Office Access database engin does to recognized =[Forms]![Switchboard]![ListSalesRegion.Column(0)] as a vlid filed name or expression plz advise "bhicks11 via AccessMonster.com" wrote: Make the criteria for that field equal to the listbox. =forms!whatform.listbox Run the query from an event of the listbox. Bonnie http://www.dataplus-svc.com Atif wrote: I am using Access 2007. Presently I am using a Command Button to call a Macro which opens a Query in Pivot Chart view. Now I want to use a ListBox which has these options NAE, NAW and EU. How can I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Passing value to Query Criteria from a ListBox
The switchboard is doing some background stuff from a table. I wouldn't run
it off the switchboard, I'd open a little form with the selection. Try that with this: forms!switchboard.ListSalesRegion.Column(0) Bonnie http://www.dataplus-svc.com Atif wrote: Thanks: I am using following criteria =[Forms]![Switchboard]![ListSalesRegion.Column(0)] it give error: Microsoft Office Access database engin does to recognized =[Forms]![Switchboard]![ListSalesRegion.Column(0)] as a vlid filed name or expression plz advise Make the criteria for that field equal to the listbox. [quoted text clipped - 13 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#5
|
|||
|
|||
Passing value to Query Criteria from a ListBox
Hi:
My form name is Switchboard. Why Query Criteria not able to recognized the Listbox. I believe some syntex error. keep in mind i am using Access 2007. Thanks "bhicks11 via AccessMonster.com" wrote: The switchboard is doing some background stuff from a table. I wouldn't run it off the switchboard, I'd open a little form with the selection. Try that with this: forms!switchboard.ListSalesRegion.Column(0) Bonnie http://www.dataplus-svc.com Atif wrote: Thanks: I am using following criteria =[Forms]![Switchboard]![ListSalesRegion.Column(0)] it give error: Microsoft Office Access database engin does to recognized =[Forms]![Switchboard]![ListSalesRegion.Column(0)] as a vlid filed name or expression plz advise Make the criteria for that field equal to the listbox. [quoted text clipped - 13 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#6
|
|||
|
|||
Passing value to Query Criteria from a ListBox
Before I go any further - did you create a form yourself and name it
switchboard or are you talking about the switchboard the system creates. Bonnie http://www.dataplus-svc.com Atif wrote: Hi: My form name is Switchboard. Why Query Criteria not able to recognized the Listbox. I believe some syntex error. keep in mind i am using Access 2007. Thanks The switchboard is doing some background stuff from a table. I wouldn't run it off the switchboard, I'd open a little form with the selection. [quoted text clipped - 22 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#7
|
|||
|
|||
Passing value to Query Criteria from a ListBox
Yes I created myself and named it as Switchboard
Atif "bhicks11 via AccessMonster.com" wrote: Before I go any further - did you create a form yourself and name it switchboard or are you talking about the switchboard the system creates. Bonnie http://www.dataplus-svc.com Atif wrote: Hi: My form name is Switchboard. Why Query Criteria not able to recognized the Listbox. I believe some syntex error. keep in mind i am using Access 2007. Thanks The switchboard is doing some background stuff from a table. I wouldn't run it off the switchboard, I'd open a little form with the selection. [quoted text clipped - 22 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#8
|
|||
|
|||
Passing value to Query Criteria from a ListBox
I also tried:
=[Forms]![Menu].[List28] the result the same, Not able to recogniazed as valid field name or expression "Atif" wrote: Yes I created myself and named it as Switchboard Atif "bhicks11 via AccessMonster.com" wrote: Before I go any further - did you create a form yourself and name it switchboard or are you talking about the switchboard the system creates. Bonnie http://www.dataplus-svc.com Atif wrote: Hi: My form name is Switchboard. Why Query Criteria not able to recognized the Listbox. I believe some syntex error. keep in mind i am using Access 2007. Thanks The switchboard is doing some background stuff from a table. I wouldn't run it off the switchboard, I'd open a little form with the selection. [quoted text clipped - 22 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via http://www.accessmonster.com |
#9
|
|||
|
|||
Passing value to Query Criteria from a ListBox
A list box has no 'value', it just has lot of rows (selected or not), and
lot of columns. A text control, or a combo box do have a (one) value, not a list box. Vanderghast, Access MVP. |
#10
|
|||
|
|||
Passing value to Query Criteria from a ListBox
You need to not use the name Switchboard - the system uses it.
Bonnie http://www.dataplus-svc.com Atif wrote: I also tried: =[Forms]![Menu].[List28] the result the same, Not able to recogniazed as valid field name or expression Yes I created myself and named it as Switchboard [quoted text clipped - 18 lines] I pass selected option from listbox to query so that it only show the specific region data i.e. NAE or NAW or EU. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200807/1 |
|
Thread Tools | |
Display Modes | |
|
|