Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dsum

Status
Not open for further replies.

dominicgingras

Technical User
Jul 15, 2002
53
CA
I have one table with customer and one table with "calls".
I want to show on the customer form all the tolal value($) of the call that that person made AND that are not paid(yes-no field).

I tried this on the form update event but its look like if my logic is wrong.. maybe its to late... its 3:30 downhere


Private Sub Form_Current()
Crédit = DSum("[Tarif]", "Appels", "[Forms]![Clients].[ClientID] and [Appels]![TransportPayé] = False")

End Sub


 
Just looking quickly at the code it looked fine, but I then realised that you had not equated the ClientId to anything, unless you wanted both of them equated to "FALSE", which did not seem logical.

Crédit = DSum("[Tarif]", "Appels", "[Forms]![Clients].[ClientID] and [Appels]![TransportPayé] = False") should perhaps read

Crédit = DSum("[Tarif]", "Appels", "[Forms]![Clients].[ClientID] = " & SelectedClientID & " and [Appels]![TransportPayé] = False")

where SelectedclientId is picked from a textbox or Combobox on your form somewhere.

Hope this explains it.

Regards


Pieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top