Results 1 to 3 of 3
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2013
    Posts
    159

    Can an unbound form contain a Textbox w Summary function?

    Suppose I begin with an unbound blank form, and drop a textbox control onto it.



    Can I somehow cause that solitary textbox to display the result of a single field in SQL statement with an aggregate function like Sum()?

    The end result will be a textbox that simply reads something like 249 lbs. I'm not trying to display multiple records or anything fancy.

    A little more context, if anyone cares: I'm trying to get a textbox on a form to tell me the Sum(tblProducts.Weight) WHERE a certain criteria is true which will distill the result set down to a single record with a single field... should be easy to display in a textbox. I already have a query yielding 1 cell of meaningful data, I just need to get it onto the textbox in the form. The truth is the Form is already bound to something completely different and it makes no sense (for my simple mind) to bring in the Products table to the Forms Recordsource and run a Sum() on a field bound within.

    Any thoughts? Thank you,
    Matt

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    yes, set the CONTROL SOURCE:
    =Dsum("field","query")

    or Dlookup, Davg….etc.

  3. #3
    MatthewGrace is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2013
    Posts
    159
    You're the man, ranman.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-16-2015, 08:13 AM
  2. Replies: 8
    Last Post: 04-12-2013, 08:59 PM
  3. Unbound, form textbox populated
    By WiReLaD in forum Access
    Replies: 7
    Last Post: 11-19-2012, 12:54 PM
  4. Unbound textbox in bound form
    By Evilferret in forum Forms
    Replies: 5
    Last Post: 08-15-2012, 01:26 PM
  5. Replies: 16
    Last Post: 10-13-2011, 07:52 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