Results 1 to 6 of 6
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Display Query field in textbox on form?

    Hi,



    I have a form that alows the user to enter a startdate and enddate then a run query button. This displays a query that gives them the total records between the dates chosen.

    Works great.....

    Here is my question,

    Instead of displaying the query in query form....can I have the query "run" in the background and the results show in a textbox on the form?

    I have tried numerous things to no avail.

    Is there a better way to do this....maybe another method besides using a query?


    Thanks,
    Kevin

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If the query returns a single record:

    =DLookup("FieldName", "QueryName")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    OK, Thank you. That works fine....but how do I get it to "run" the query but not "display" it.....

    In other words, I just want the query to run and display the results in the textbox (it is doing this now thanks to you) but I don't want the query to come up.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Don't run the query. That function will run it in the background.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    In my messing around.....now my query does not work as expected.

    I have

    LoadID LoadDate

    Count Group by

    (Show) (Do Not SHow)

    under LoadDate I have ..... >= Forms!frmQueryMenu.btnStartDate < Forms!frmQueryMenu.btnEndDate +1



    It was working, but somehow I did something and now it is displaying the records separately (1),(3),(3) ..... instead of one total (7)

    Any idea what happened?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I think you want Where on the date field rather than Group By.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 5
    Last Post: 06-28-2011, 06:40 PM
  2. Display PASS or FAIL using Unbound textbox
    By Shambler2 in forum Reports
    Replies: 7
    Last Post: 06-02-2011, 11:19 AM
  3. Display Web Page in a MS Access Form/Field
    By webinteractive in forum Forms
    Replies: 3
    Last Post: 04-01-2011, 03:53 PM
  4. Replies: 2
    Last Post: 11-16-2010, 10:55 AM
  5. Replies: 2
    Last Post: 09-26-2009, 07:19 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