Results 1 to 4 of 4
  1. #1
    Ganesh7299 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    9

    Display query results on user form

    Hi Experts,



    I have just started with MS access and seeking for help for the same on below issue.

    I have created form and would like to display query results on form (in textbox), which is executed based on combobox change event on the same form.

    Thanks in advance,
    Ganesh

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    The usual approach would be to bind a form to a query and then filter the results via the combobox's value.

    It is hard to understand what you want to do. Perhaps a main form with a combo and a subform dependant on the combobox is appropriate.

  3. #3
    Ganesh7299 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    9
    I have fond the solution as below for displaying query results in the textbox.

    created query name as "comm"
    Code:
    SELECT Sum([FYE 2013].[Jan 2013]) AS commu
    FROM [FYE 2013]
    WHERE [FYE 2013].[site] =IIf(Forms!Form1![site]="All","'*'",Forms!Form1![site]);
    then applied Dsum function in Control source property of textbox
    Code:
    =DSum("commu","comm")
    Now I am facing problem if combobox site value is "All" then it is showing blank, as there is no record mating with "All", but i would like to display all records sum in the textbox, if combobox site value = "All"

    Any help highly appreciated....

    Regards,
    Ganesh

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Name of combobox is site? Is site a number or text field? What is value of the combobox?

    Try:

    =DSum("[Jan 2013]", "[FYE 2013]", IIf([site]="All", "", "site=" & [site]))


    The table and field names make me think this data structure is not normalized.
    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.

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

Similar Threads

  1. Display QUERY results into SUB FORM
    By taimysho0 in forum Programming
    Replies: 9
    Last Post: 11-23-2011, 12:26 PM
  2. Replies: 1
    Last Post: 12-01-2010, 11:10 AM
  3. Form/Query Display Results Question
    By AcmeGearSteve in forum Access
    Replies: 5
    Last Post: 10-12-2010, 01:21 PM
  4. Display Query Results on a Form
    By P5C768 in forum Queries
    Replies: 5
    Last Post: 05-04-2010, 11:04 AM
  5. display query results in a form
    By P5C768 in forum Queries
    Replies: 3
    Last Post: 08-14-2009, 03:02 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