Results 1 to 5 of 5
  1. #1
    Desmondo is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Location
    Gold Coast, Australia
    Posts
    6

    Question Info from queries in text boxes

    I have a form with text boxes that I would like to display vital stats from various queries not related to the form and have tried several ways to do it without success and am sure it must be something quite simple. Currently I am trying to use count in the control source of a text box to extract the info from a query not linked to the form. One example is I have a query with dates in it and would like to display how many records have dates <now(). Any help or suggestions on the best way to do this is appreciated, I have used access for a couple of years for simple tasks and now trying to get more in depth so my apologies if this is primary school stuff, we all have to start somewhere

  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
    Try DCount() in the textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Desmondo is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2012
    Location
    Gold Coast, Australia
    Posts
    6
    That did it.... thanks for the fast response. I had tried this and must have had the formatting wrong. How do I add/format <now() to save having a separate query just for this. I have tried various ways and now have =DCount("fieldname1","queryname",["fieldname1"<now()]) what have I got wrong ? Cheers.
    I worked it out =DCount("fieldname1","queryname","fieldname1<now() ") just a formatting issue. Thanks
    Last edited by Desmondo; 08-29-2015 at 07:30 PM. Reason: problem solved

  4. #4
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Dcount("[fieldname1]","[queryname]","[fieldname]<now()")

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    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: 11
    Last Post: 08-06-2014, 09:47 AM
  2. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  3. Replies: 3
    Last Post: 02-07-2013, 09:53 PM
  4. Replies: 10
    Last Post: 12-11-2010, 11:01 PM
  5. Getting Info From Tables with Queries
    By SteveI in forum Queries
    Replies: 0
    Last Post: 03-01-2010, 08:33 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