DSum Problem

  • Thread starter Anthony Viscomi
  • Start date
A

Anthony Viscomi

I am try to use the DSum function in the following manner:

Dim intBaseTotal as Integer
Dim intFilter as Long

intFilter = Me.ID
intBaseTotal= DSum("[Base_Price]", "tbl_OrderB", "[ID_B]"= intFilter)
Me.txtBasePriceTotal= intBaseTotal

I keep getting a "Type Mismatch"; if I replace the variable (intFilter) with
an actual value (4) it works fine. Any thoughts?

Thanks!
Anthony Viscomi
 
E

Ernie

Try it this way:
intBaseTotal= DSum("[Base_Price]", "tbl_OrderB", "[ID_B]="
& [intFilter])

-----Original Message-----
I am try to use the DSum function in the following manner:

Dim intBaseTotal as Integer
Dim intFilter as Long

intFilter = Me.ID
intBaseTotal= DSum
("[Base_Price]", "tbl_OrderB", "[ID_B]"= intFilter)
 
A

Anthony Viscomi

Works great...thanks!
Ernie said:
Try it this way:
intBaseTotal= DSum("[Base_Price]", "tbl_OrderB", "[ID_B]="
& [intFilter])

-----Original Message-----
I am try to use the DSum function in the following manner:

Dim intBaseTotal as Integer
Dim intFilter as Long

intFilter = Me.ID
intBaseTotal= DSum
("[Base_Price]", "tbl_OrderB", "[ID_B]"= intFilter)
Me.txtBasePriceTotal= intBaseTotal

I keep getting a "Type Mismatch"; if I replace the variable (intFilter) with
an actual value (4) it works fine. Any thoughts?

Thanks!
Anthony Viscomi


.
 
Top