A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Passing value to Query Criteria from a ListBox



 
 
Thread Tools Display Modes
  #11  
Old July 16th, 2008, 07:53 PM posted to microsoft.public.access.queries
Atif
external usenet poster
 
Posts: 45
Default Passing value to Query Criteria from a ListBox

Hi Bonnie:
I changed the Form Name as "Menu" the result is same

Hi Michel:

I assiged the Listbox value to a text box;
List box Clic event code:

Private Sub List82_Click()
Text86.Value = List82.Column(0)
DoCmd.OpenQuery "SalesGroupManager", acViewPivotChart
End Sub

expression in Query Critaria is:
[Forms]![Text86].[Value]

the error is same " engin does not recognize [Forms]![Text86].[Value] as
Valid Field or Expression.

Atif

"bhicks11 via AccessMonster.com" wrote:

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


  #12  
Old July 16th, 2008, 10:31 PM posted to microsoft.public.access.queries
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Passing value to Query Criteria from a ListBox

Try:

Forms!formname.Text86 = Forms!formname.list82.column(0)

By the way - I wouldn't use the word MENU either.

Bonnie
http://www.dataplus-svc.com

Atif wrote:
Hi Bonnie:
I changed the Form Name as "Menu" the result is same

Hi Michel:

I assiged the Listbox value to a text box;
List box Clic event code:

Private Sub List82_Click()
Text86.Value = List82.Column(0)
DoCmd.OpenQuery "SalesGroupManager", acViewPivotChart
End Sub

expression in Query Critaria is:
[Forms]![Text86].[Value]

the error is same " engin does not recognize [Forms]![Text86].[Value] as
Valid Field or Expression.

Atif

You need to not use the name Switchboard - the system uses it.

[quoted text clipped - 11 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

  #13  
Old July 17th, 2008, 03:37 PM posted to microsoft.public.access.queries
Atif
external usenet poster
 
Posts: 45
Default Passing value to Query Criteria from a ListBox

Thanks alot for the help.

actually it was not a Syntex problem, I was running a Select Query based on
two Crosstab queries. Now I have changed crosstab queries to select and
everything working fine.

Michel:

we can use listbox to passvalues to a Query
[Forms]![Main]![GrpMgrNo]
GrpMgrNo is a ListBox.

thanks

"Atif" wrote:

Hi Bonnie:
I changed the Form Name as "Menu" the result is same

Hi Michel:

I assiged the Listbox value to a text box;
List box Clic event code:

Private Sub List82_Click()
Text86.Value = List82.Column(0)
DoCmd.OpenQuery "SalesGroupManager", acViewPivotChart
End Sub

expression in Query Critaria is:
[Forms]![Text86].[Value]

the error is same " engin does not recognize [Forms]![Text86].[Value] as
Valid Field or Expression.

Atif

"bhicks11 via AccessMonster.com" wrote:

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


  #14  
Old July 17th, 2008, 03:55 PM posted to microsoft.public.access.queries
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Passing value to Query Criteria from a ListBox

Glad to hear you have found a solution!

Bonnie
http://www.dataplus-svc.com

Atif wrote:
Thanks alot for the help.

actually it was not a Syntex problem, I was running a Select Query based on
two Crosstab queries. Now I have changed crosstab queries to select and
everything working fine.

Michel:

we can use listbox to passvalues to a Query
[Forms]![Main]![GrpMgrNo]
GrpMgrNo is a ListBox.

thanks

Hi Bonnie:
I changed the Form Name as "Menu" the result is same

[quoted text clipped - 32 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

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.