Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    England
    Posts
    26

    Unanswered: Make default value sum to two other fields

    I have got 3 fields in a table.

    Is there any way to make one field the sum of the other two fields as a default.

    Everything I do seems to bring up error messages.

    Regards,
    Beth
    Beth

  2. #2
    Join Date
    Nov 2003
    Location
    Plymouth, UK
    Posts
    59
    I can make it work in a form, view attachment, and check out the form sum!!

    Hope it helps,
    Attached Files Attached Files

  3. #3
    Join Date
    Nov 2003
    Location
    Riga, Latvia
    Posts
    36

    Re: Make default value sum to two other fields

    Originally posted by elisabeth
    I have got 3 fields in a table.

    Is there any way to make one field the sum of the other two fields as a default.

    Everything I do seems to bring up error messages.

    Regards,
    Beth
    Seems fairly obvious that you (unfortunately) won't be able to use the default value property as sum function in a table, since at the time when default value will be assigned to your sum field, the two fields to sum will yet be empty.

    However, what you can do if the solution proposed above does not suit your needs, is make a query like

    SELECT tblTable.Field1, tblTable.Field2, ([Field1]+[Field2]) AS SumOfFields1and2 FROM tblTable

    and use it [i]instead[i/] of the table wherever you need it. Just don't forget to set the .locked property to 'Yes' if you use the query as form record source and place the field SumOf... on a form.
    Replies based on my configuration: Windows XP / Microsoft Office Access 2003 unless specified otherwise.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •