Results 1 to 2 of 2
  1. #1
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58

    Question Dlookup over Crosstab?

    I am using a crosstab query, where I have 'Markets' as the columns heading, and 'Casetype' in the rows. And the matching total number of cases (I made the crosstab give count) in the corresponding fields. (This crosstab is based on a query that gives list of all cases with casetype and markets).



    I am trying to use a Dlookup to reflect these counts on a textbox in a form. But its showing up a #Name? error.

    This is what I did. I put a textbox on a form and in its control source I gave the below code:

    =DLookUp("CountOfcasenum","qryCrsCasesByMarkets"," Markets = 'Newyork'" And "Casetype = 'AUTO'")

    Is it wrong to give two fields as the criteria? Which is the best way to go ahead with this?

  2. #2
    KrisDdb is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    58

    Figured it out myself :)

    I used a Dcount (didnt even know about this until now!!) instead of a Dlookup for a count.

    If this might help someone, heres the answer:
    =DCount("casenum","qryCrsCasesByMarkets"," Markets = 'Newyork' AND Casetype = 'AUTO'")

    Cheers

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Crosstab query
    By Deutz in forum Queries
    Replies: 8
    Last Post: 01-08-2013, 03:37 PM
  2. Crosstab Query
    By BLD21 in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 11:58 AM
  3. Receiving <> in crosstab
    By Brian62 in forum Queries
    Replies: 0
    Last Post: 03-21-2011, 05:02 PM
  4. Crosstab example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:07 AM
  5. Crosstab Queries
    By albst130 in forum Queries
    Replies: 0
    Last Post: 03-07-2007, 09:32 AM

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