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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Expression in sorting and grouping



 
 
Thread Tools Display Modes
  #1  
Old November 23rd, 2005, 04:18 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Expression in sorting and grouping

I have a query that has 4 different itemtypes three of these types I use in
the heading of my report, the 4 type "m" can have multiple records and I want
to show only the type M in the detail section. I've been trying to use an
expression in the sorting and grouping Itemtype = M but it gives me a prompt
which I don't want. Is there a way to do this in the sorting and grouping or
do I need to do it some other place.
Thanks for any help
  #2  
Old November 23rd, 2005, 05:03 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Expression in sorting and grouping

Sorting and Grouping is for applying an order/sequence to your records. From
your description, it sounds like you want to filter the records. If you want
to filter, add a where clause to the DoCmd.OpenReport line of code:

Assuming you have a command button on your form that opens the report. Add a
check box to the form "chkOnlyM". Your code might look something like:

Dim strWhere as String
If Me.chkOnlyM = True Then
strWhere = "[ItemType]='M' "
End If
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere

--
Duane Hookom
MS Access MVP


"CD Tom" wrote in message
...
I have a query that has 4 different itemtypes three of these types I use in
the heading of my report, the 4 type "m" can have multiple records and I
want
to show only the type M in the detail section. I've been trying to use an
expression in the sorting and grouping Itemtype = M but it gives me a
prompt
which I don't want. Is there a way to do this in the sorting and grouping
or
do I need to do it some other place.
Thanks for any help



  #3  
Old November 23rd, 2005, 06:07 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Expression in sorting and grouping

Thanks that will work.


"Duane Hookom" wrote:

Sorting and Grouping is for applying an order/sequence to your records. From
your description, it sounds like you want to filter the records. If you want
to filter, add a where clause to the DoCmd.OpenReport line of code:

Assuming you have a command button on your form that opens the report. Add a
check box to the form "chkOnlyM". Your code might look something like:

Dim strWhere as String
If Me.chkOnlyM = True Then
strWhere = "[ItemType]='M' "
End If
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere

--
Duane Hookom
MS Access MVP


"CD Tom" wrote in message
...
I have a query that has 4 different itemtypes three of these types I use in
the heading of my report, the 4 type "m" can have multiple records and I
want
to show only the type M in the detail section. I've been trying to use an
expression in the sorting and grouping Itemtype = M but it gives me a
prompt
which I don't want. Is there a way to do this in the sorting and grouping
or
do I need to do it some other place.
Thanks for any help




 




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
Sorting and Grouping expression Wm Setting Up & Running Reports 1 April 27th, 2005 04:21 AM
Still need help on grouping and sorting Tia Setting Up & Running Reports 2 January 12th, 2005 01:03 AM
Repost: Help on Grouping and Sorting Tia Setting Up & Running Reports 0 January 7th, 2005 07:51 PM
Sorting & Grouping Question Matt Setting Up & Running Reports 2 August 3rd, 2004 09:18 PM
Sorting and Grouping using an expression of LEFT$ DellaCroce Setting Up & Running Reports 2 July 14th, 2004 08:08 PM


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