Results 1 to 4 of 4
  1. #1
    antoniomaia is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    2

    Obter num formulário a soma de valores em tabelas

    Gostaria que me ajudassem na seguinte situação:



    Tenho 1 tabela de veículos (Veículo XXX, YYY e ZZZ) e outra tabela de despesas em que cada veículo pode ter mais que uma despesa.

    Gostaria que o valor das despesas tanto na Tabela Veículos como no Formulário Veículos fosse obtido automaticamente da Tabela de Despesas.

    Criei um evento mas julgo que estará errado.

    Obrigado.
    Attached Files Attached Files

  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
    You will get more response if you can post the question in English.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    antoniomaia is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    2

    Get in a Form a sum of the values ​​tables

    What I would like to help me in following situation:


    I have a table "VEÍCULOS" (Vehicle XXX, YYY and ZZZ) and another table DESPESAS (costs) them every vehicle can have more than a expense.


    I want then the amount of expenses is obtained automatically in the table vehicles and in the vehicles Form.


    I created a event but I think that is wrong.

    Thank you.
    Attached Files Attached Files

  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
    Try this as the control source of the textbox on the form:

    =DSum("despesa","despesas","placa = '" & [placa] & "'")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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