A function (vba) that sums a table's field and puts it in text box in form

JuniorWoodchuck24

Registered User.
Local time
Today, 08:37
Joined
Jan 13, 2010
Messages
59
Is there a way to define a function in VBA that sums a table's field and automatically puts it in a text box?

Currently I'm using the following:
List Box with it's RowSource the following:
SELECT Sum([Total Cost]) AS Total FROM OverallWeight;

The error I get with this is that it's not really a number value so if I compare it to something else it gives me an error.
 
You need the DSum("Field","Table","Criteria=Condition") method

David
 

Users who are viewing this thread

Back
Top Bottom