Results 1 to 5 of 5
  1. #1
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50

    Using a Query i want to check and don't want to show in listbox

    IN Table1----sale_amt and in table2-----collection_amt.group by sale_id i want to sum collection_amts.

    i got a solution for this.

    This Query solution is assigned to listbox.

    but i want in the same query ---------if sumofcollection_amts is equal to sale_amt. that record don't show in the listbox. if those are unequal only shown in listbox . HOw?

    is it possible in the same query.

    or

    i tried one more method. code written in form_load
    for i=0 to listbox.listcount
    if listbox.column(6,i) ie.,sale_amt=listbox.column(7,i) i.e., sumofcollectionamt then


    listbox.removeitem i
    end if

    but it gives error . listbox rowsoucetype is changed to valuelist. when i change also not working how?


    Please give soultion as early as possible. which is possible first method or second method

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe with subquery in the combobox RowSource query.

    Review http://allenbrowne.com/subquery-01.html
    especially the example for Aggregation: Counts and totals
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    SELECT DISTINCTROW a.M_NUM, a.V_NUM, a.SP_ID, a.Pd, b.Sold, b.S_ID, b.SNAME, b.Sale_AMT, Sum(c..COLLECTION_AMT) AS SumOfCOLLECTION_AMT
    FROM (a INNER JOIN b ON (a.SP_ID = b.SP_ID) AND (a.P_ID = b.P_ID)) INNER JOIN c ON b.S_ID = c.S_ID
    GROUP BY a.m_NUM, a.V_NuM, a.s_ID, a.PD, b.Sold, b.S_ID, b.SNAME, b.SALE_AMT
    HAVING (((b.Sold)=Yes));


    where i can use sale_amt is not equal to sumofcollectionamt. sale_amt is in b table, sumofcollectionamt is done inthis query only i want to check how Please help me

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Did you review the referenced link? The sumofcollectionamt would probably by the nested subquery. I can't be more specific without knowing your data structure and being able to test query. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sireesha is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    50
    Thanks I got the solution for the above.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  2. Replies: 1
    Last Post: 07-26-2012, 11:45 AM
  3. Subform to show records of Listbox
    By gbmarlysis in forum Forms
    Replies: 5
    Last Post: 02-27-2012, 04:03 PM
  4. Check-box to hide/show input fields
    By RapidFireGT in forum Forms
    Replies: 2
    Last Post: 12-05-2011, 05:55 PM
  5. Can a Check-mark be displayed in a Listbox
    By caddcop in forum Forms
    Replies: 3
    Last Post: 04-26-2011, 03:27 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