Results 1 to 6 of 6
  1. #1
    yagerlegi is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2014
    Posts
    29

    SQL Format for Sum

    Hello,



    I have a form that provides the amount paid when a client name is selected. The problem is when the sum displays in a text box using a sql statement it's not formatting correctly. I want to format the box to add commas when the number is thousands. Here is my sql syntax

    SELECT Round(Sum([tblclient].[total])) AS Expr1 FROM tblclient WHERE (((tblpurchase.client)=[forms]![frm_purchased_1]![client]) AND ((
    [listpurchased])=[tblclient].[client]));

    Thank you

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Open the Form in Design View, select your Text Box and change the Format property to "Standard".

  3. #3
    yagerlegi is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2014
    Posts
    29
    Sorry, it a list box and not a text box. The sql statement will not work with a textbox.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Why not just do the all the calculations in your query, and make the query the source of your form?

  5. #5
    yagerlegi is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Oct 2014
    Posts
    29
    I guess I could have done that but its to late now. I need to complete this project this week. Is there anyway to format the numbers?

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I guess I could have done that but its to late now
    Not really. You can change the Record Source of an existing Form pretty easily.

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

Similar Threads

  1. Replies: 0
    Last Post: 11-19-2014, 05:47 AM
  2. Replies: 3
    Last Post: 09-07-2013, 04:59 PM
  3. Replies: 4
    Last Post: 03-12-2013, 06:49 PM
  4. Number Format to General Format
    By mkc80 in forum Access
    Replies: 2
    Last Post: 05-05-2012, 02:10 AM
  5. Replies: 3
    Last Post: 03-05-2012, 04:06 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