Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
  1. #16
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276

    Any help available?

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm on the road. Hopefully Steve can follow up.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I looked at your dB. The problem (well, not so much a problem - more the totals queries work a little different that a standard query) is that you are using totals queries.
    With a totals query, all fields in one or more records have to match to be grouped together to have one record (line) unless you have a different option for the Total line.
    Having a column "PurDate" as "Group By" causes two lines for Feb 2014 when "PurCompanyName" equals "AK Transport" and "Purchase Description" equals "TR Charges": 2/14/2014 and 2/24/2014.

    I changed the form/query and the code to open the report. The numbers from the report matches your picture. (See "Sample 01D")
    Attached Files Attached Files

  4. #19
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Thank you Paul & Steve for your help and guidence.
    With your help I am able to get the reports on time otherwise I would have been stuck with lot of paper work.
    One request, I am attaching the SAMPLE 01E please see if I have done it correctly as you mentioned.
    Untill now I had never worked with crosstab querys, but now I made a Query and a report. But am failed to understand why in crosstab querys formula's dont work in criteria.
    I tried to filter the report based on combo boxes on a form. Simple filteration is working but when I try to generate report by Account Title, Item Description & Units. It does not work. If you have time can you please have a look at the sample 01E and the FORM is DialogMonYrCross.
    Thank you again for your kind help.


    Attachment 23817

  5. #20
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Untill now I had never worked with crosstab querys
    I have never had occasion to use a crosstab query, so I won't be much help at this point.

    Maybe Paul will know.

    I kind of "roll my own" crosstabs. No one told me it couldn't be done, but it works for what I need. If I get some free time, I will take a look.

  6. #21
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Thanks Steve
    I appreciate

  7. #22
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I get an error trying to download the attachment in post 19.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    I have uploaded 01F - SAMPLE again.

    01F - SAMPLE.zip

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I'm not clear on what you're trying to do. You've got a crosstab based on another crosstab? There is no criteria. The error when running the second crosstab is because the field you specified doesn't exist:

    MonYrCross.MonYrCross.Yr

    The first crosstab returns a year, not the yr field. In other words, 2014 & 2015, not yr.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #25
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    I guess you are looking at Query: MonYrCrossUnits
    This was suppose to be deleted. I was testing this.

    If you open the form DialogMonYrCross on this form I have highlighted with red lables.
    When I open the report it shows other units also where as I only wanted it to show the values by month where Kg is used.

    I tried to put the Criteria [Forms]![DialogMonYrCross].[CboITRC] under Purchase Units in crosstab query MonYrCrossUnits but it does nt accept.

  11. #26
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Well, you've got a wherecondition that doesn't include that field:

    strCriteria = "[Purchase Description] = """ & Me.cboCustomers & """"

    To use a query criteria, you have to set the parameters:

    http://allenbrowne.com/ser-67.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #27
    aamer is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Location
    Pakistan
    Posts
    276
    Thanks a million Paul & Steve.

    Because of both of you my life has become easy. specially the link http://allenbrowne.com/ser-67.html Paul sent me is very informative & helpful.
    I am able to fix the 01F - SAMPLE and got the desired result. This concludes the project for the time being.

    Attached is the 01G - SAMPLE.

    Thank you both once again.

    01G - SAMPLE.zip

  13. #28
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #29
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What Paul said.



    Ready to mark this solved?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 20
    Last Post: 10-13-2015, 09:05 AM
  2. Replies: 3
    Last Post: 10-16-2014, 08:49 AM
  3. Replies: 4
    Last Post: 03-10-2014, 12:18 PM
  4. Replies: 7
    Last Post: 05-28-2013, 09:11 AM
  5. Replies: 1
    Last Post: 05-04-2013, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums