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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |