Results 1 to 13 of 13
  1. #1
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42

    Trying to populate a text box on form with the result of a query

    Hello All



    this is my situation...

    I have several different queries for a form with a lot of command buttons. I had an idea and hope it's possible!

    I would like for the result(count of records) of a query to populate automatically when you open the form in a unbound text box with out pushing the command button to actually get the result(with details instead of just a count that i'm looking for)....

    Please help!

    also the query has different criteria therefore i need the result of the whole query not just a particular column in the query.

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

  3. #3
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    I have tried this and did the DCount from the from/ the table / the query and it's giving me #Error .......

  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
    Hard to figure out the error when I don't know what you tried.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    sorry..
    =DCount([Manstat_19],"cert")

  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
    Both are string arguments. Try

    =DCount("[Manstat_19]","cert")

    or simply

    =DCount("*","cert")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    This is driving me banana's!!!!!! ...

    Not sure what i'm doing wrong but it is still giving me the #Error message. I have even did make-table query .....

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Cert is the name of the query? Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    sorry ManStat_19 is the name of the query and "cert" is the column that I would be counting how many records in the query with the set criteria's....

  10. #10
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    ok now i did it backwards : DCount("cert", [Manstat_19]!cert) and it gave me #Name? message

  11. #11
    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("*","[Manstat_19]")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    BOOOOYYYYAAAAAAA

    GOT IT!!!!!!! =ZDCount("cert","ManStat_19") .............. I took out the [] and it worked!!!!!!!

    thanks soooo much for helping me!!!

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problemo!
    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: 1
    Last Post: 06-08-2012, 11:14 AM
  2. Replies: 8
    Last Post: 05-16-2012, 09:30 AM
  3. Replies: 1
    Last Post: 09-28-2011, 09:48 PM
  4. Replies: 1
    Last Post: 09-07-2011, 09:22 AM
  5. Replies: 17
    Last Post: 08-19-2011, 01:19 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