Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2014
    Posts
    4

    Dsum criteria

    Good Morning

    I will try to explain what i want.

    I have a form that has the following fields:

    Field1: Familiar: a dropdownlist with names

    Field2: Valor apresentado : a currency field

    Field3: Total apresentado ate a data: (A calculated field, currency)

    In each record I'm placing an amount in field2 to a given name in field1.

    In field3 (Total apresentado ate a data) i want the total amount of money given by "name"

    I've written the following statment in "After update" of field2

    Private Sub Valor_apresentado_AfterUpdate()

    DoCmd.RunCommand acCmdRefresh


    Dim nome As String




    nome = Me.Familiar




    Me.Total_comparticipado_até_ŕ_data = DSum("[Valor apresentado]", "[livros]", "[familiar] = " & nome)

    I've tried several things but it didn't work

    could you help please
    Best Regards

    manuel

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Build a query that sums the values via person.
    The form is connected to this query.
    When the user picks the person out of the combo , refresh the form filter.
    then all the fields will populate.

    Code:
    cboPerson_afterupdate()
    Me.filter = "[personID] = " & cboPerson
    me.filteron = true

  3. #3
    Join Date
    Sep 2014
    Posts
    4
    Thanks for the answer

    I've already builded the query what i dont know is how to connect the form to the query and at the same time fill the original table?

    Also maybe i didn't explained well what i want:

    I'm getting invoices from my associates, i'm getting from each the mane and the ammount .
    I need To control the amount (to further calculations) that each associate presents.

    Best regards

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    In the form design, in the properties
    data tab, set the record source to the query you want to see.

    Then You can enter data from the associates
    or paste it in the form
    or import it via XL or text.

  5. #5
    Join Date
    Sep 2014
    Posts
    4
    Ok, Thanks

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

Similar Threads

  1. Value from DSUM with multiple criteria wrong
    By maxmaggot in forum Reports
    Replies: 4
    Last Post: 04-12-2014, 05:21 PM
  2. dsum with criteria Not like 38,39,40,41
    By sdel_nevo in forum Programming
    Replies: 3
    Last Post: 06-13-2013, 03:23 PM
  3. Dsum criteria
    By bdaniel in forum Queries
    Replies: 4
    Last Post: 11-27-2011, 03:41 PM
  4. Dsum criteria problem
    By leonhuynh2006 in forum Queries
    Replies: 3
    Last Post: 10-04-2011, 03:18 AM
  5. How to use a create a DSum with multiple criteria
    By FlyingDisc in forum Reports
    Replies: 1
    Last Post: 01-05-2011, 08:31 PM

Tags for this Thread

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