creating a "line total" price in design view

rvd48

Registered User.
Local time
Today, 22:41
Joined
Feb 2, 2004
Messages
123
i have a form with a datasheet, the important fields are "Unit Price" and "Quantity".

i want it to display the sum of: "Unit Price" Times "Quantity",

i have gone into design view, added a new field and written this: Clng(([Quantity]*[UnitPrice])AS[Line Total] with "line total" as the name of the field.

when i go into DataSheet view, all the entries in the "line total" field come up as: #Name?

could someone help me on this, on what i need to change in my statement?

cheers.
 
Last edited:
=[Quantity]*[UnitPrice] as the control source for an unbound textbox
 
rvd48 said:
i have a form with a datasheet, the important fields are "Unit Price" and "Quantity".

i want it to display the sum of: "Unit Price" Times "Quantity",

i have gone into design view, added a new field and written this: Clng(([Quantity]*[UnitPrice])AS[Line Total] with "line total" as the name of the field.

when i go into DataSheet view, all the entries in the "line total" field come up as: #Name?

could someone help me on this, on what i need to change in my statement?

cheers.

Set the control Source of the text box
Code:
 =([Unit Price]*[Quantity])

Set the Name of the text box to Line Total
 
thanks for that guys, such a simple piece of code, who would thought... :eek:
 

Users who are viewing this thread

Back
Top Bottom