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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

filter crosstab by listbox selection



 
 
Thread Tools Display Modes
  #1  
Old January 25th, 2006, 10:18 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default filter crosstab by listbox selection

I'm just curious if it is possible to filter a crosstab query (presented in a
listbox) by a selection in another listbox on a different form.

I try inserting the criteria - [forms]![search]![list15] - into the criteria
section on the QBE builder, but when i run the form by itself it says access
does not realize [forms]![search]![list15] as a valid expression... when ran
after its listbox 'parent' form, nothing appears.

Any help or suggestions would be great!


  #2  
Old January 26th, 2006, 04:46 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default filter crosstab by listbox selection

You must declare this parameter in your crosstab query.

Open the query in design view.
Choose Parameters from the Query menu.
In the dialog, enter:
[forms]![search]![list15] Long

The data type in the dialog should match the data type of the field you are
placing this expression under. For example, if it goes under a Text type
field, you declare Text instead of Long in the dialog.

Note that this approach will not work for a multi-select list box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"polisci grad" wrote in message
...
I'm just curious if it is possible to filter a crosstab query (presented
in a
listbox) by a selection in another listbox on a different form.

I try inserting the criteria - [forms]![search]![list15] - into the
criteria
section on the QBE builder, but when i run the form by itself it says
access
does not realize [forms]![search]![list15] as a valid expression... when
ran
after its listbox 'parent' form, nothing appears.

Any help or suggestions would be great!



  #3  
Old January 26th, 2006, 02:10 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default filter crosstab by listbox selection

Thanks Allen, I've done this now, and things show up in the child listbox but
they are not specific to the selection in the parent listbox. It just reveals
all of the records. In this instance, the data is text.



"Allen Browne" wrote:

You must declare this parameter in your crosstab query.

Open the query in design view.
Choose Parameters from the Query menu.
In the dialog, enter:
[forms]![search]![list15] Long

The data type in the dialog should match the data type of the field you are
placing this expression under. For example, if it goes under a Text type
field, you declare Text instead of Long in the dialog.

Note that this approach will not work for a multi-select list box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"polisci grad" wrote in message
...
I'm just curious if it is possible to filter a crosstab query (presented
in a
listbox) by a selection in another listbox on a different form.

I try inserting the criteria - [forms]![search]![list15] - into the
criteria
section on the QBE builder, but when i run the form by itself it says
access
does not realize [forms]![search]![list15] as a valid expression... when
ran
after its listbox 'parent' form, nothing appears.

Any help or suggestions would be great!




  #4  
Old January 26th, 2006, 02:17 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default filter crosstab by listbox selection

never mind, fixed it....

by the way, if i wanted to make this work for multiselect listbox, would
this be possible? I have a sample of code i found for this at your website
under "Use a multiselect list box to filter a report".

Thanks for the help!


"Allen Browne" wrote:

You must declare this parameter in your crosstab query.

Open the query in design view.
Choose Parameters from the Query menu.
In the dialog, enter:
[forms]![search]![list15] Long

The data type in the dialog should match the data type of the field you are
placing this expression under. For example, if it goes under a Text type
field, you declare Text instead of Long in the dialog.

Note that this approach will not work for a multi-select list box.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"polisci grad" wrote in message
...
I'm just curious if it is possible to filter a crosstab query (presented
in a
listbox) by a selection in another listbox on a different form.

I try inserting the criteria - [forms]![search]![list15] - into the
criteria
section on the QBE builder, but when i run the form by itself it says
access
does not realize [forms]![search]![list15] as a valid expression... when
ran
after its listbox 'parent' form, nothing appears.

Any help or suggestions would be great!




 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple selection in a listbox JOM General Discussion 5 August 29th, 2006 08:57 PM
Print Search Listbox Results in Report Filter Preview ... HELP!!! [email protected] Setting Up & Running Reports 0 January 27th, 2006 07:34 PM
listbox selection asa General Discussion 1 June 4th, 2005 02:52 PM
Update a Listbox by Combo selection dogpigfish Using Forms 1 May 17th, 2005 06:43 PM


All times are GMT +1. The time now is 09:50 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.