Results 1 to 2 of 2
  1. #1
    graciemora is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    31

    Calculated fields

    Hi, I have a form, and I added a calculated field, but when I Try to sum the total It just give me the options to count/None, My quantity field is number data type and my price field is number data type also. What I am doing wrong?


    thanks for your help

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Well I guess you have a tabular form with two rows quantity and prices you have a unbound text box with that multiplies the value in this two rows and now u want to find the total of all the unbound text boxes.

    I have a table with two Fields A and B which are number Feild. I have a A tabular form with an unbound text box which displays the A*B.

    I have written this Function that will help me to display the sum:

    Option Compare Database
    Dim intTotal As Integer
    Dim intmultiply As Integer
    Function MyTotal() As Integer
    Set rst = CurrentDb.OpenRecordset("Table5")
    Do While Not rst.EOF
    intmultiply = rst!c * rst!b
    intTotal = intTotal + intmultiply
    intmultiply = 0
    rst.MoveNext
    Loop
    rst.Close
    Set rst = Nothing
    MyTotal = intTotal
    intTotal = 0
    End Function

    Check Form5 attached with this post. The code is in the standard module 1 and there is a code attached to the on current event of the form:

    Me.Text13 = MyTotal()

    This code ensures that the total is Displayed.

    if this solves your problem mark this thread solved.

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

Similar Threads

  1. Calculated field
    By nashr1928 in forum Forms
    Replies: 3
    Last Post: 07-22-2010, 05:10 AM
  2. calculated fields
    By nashr1928 in forum Forms
    Replies: 1
    Last Post: 07-21-2010, 04:49 PM
  3. Summing Calculated Fields
    By Zoran in forum Queries
    Replies: 1
    Last Post: 03-31-2010, 01:59 PM
  4. Sum of calculated fields
    By nkuebelbeck in forum Forms
    Replies: 9
    Last Post: 03-12-2010, 01:32 PM
  5. many decimal places in calculated fields
    By GordS in forum Access
    Replies: 1
    Last Post: 02-04-2009, 11:12 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