GolferJohn
Technical User
This should be a very simple problem, yet it eludes this simple newbie.
I have in my main table a numeric field 'ratio' and an unbound textbox 'Text111' on my form.
I entered the following code:
Private Sub Form_Current()
Text111 = (ratio)
End Sub
and lo and behold! the same value in the field 'ratio' on my form appeared in 'text111' So the textbox will accept numbers.
If I insert the code: (where rollbacks is the name of the underlying table)
Private Sub Form_Current()
Text111 = DSum(ratio, rollbacks)
End Sub
I get a compile error 'Expected variable or proceedure, not project'
My database (project?) is called 'Stocks', however my form is also called 'rollbacks' (is this a problem?)
From the msdn library I read:
DSum(expr, domain[, criteria])
expr - An expression that identifies the numeric field whose values you want to total. It can be a string expression identifying a field in a table or query, or . . . . .
domain - A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name.
Private Sub Form_Current()
Me!Text111 = DSum(ratio, rollbacks)
End Sub
yields the same result.
Private Sub Form_Current()
Text111 = Sum(ratio)
End Sub
gives me the error Sub function not defined.
I cannot for the life of me see what I am doing wrong!
Any help would be much apprreciated
Thanks, John
I have in my main table a numeric field 'ratio' and an unbound textbox 'Text111' on my form.
I entered the following code:
Private Sub Form_Current()
Text111 = (ratio)
End Sub
and lo and behold! the same value in the field 'ratio' on my form appeared in 'text111' So the textbox will accept numbers.
If I insert the code: (where rollbacks is the name of the underlying table)
Private Sub Form_Current()
Text111 = DSum(ratio, rollbacks)
End Sub
I get a compile error 'Expected variable or proceedure, not project'
My database (project?) is called 'Stocks', however my form is also called 'rollbacks' (is this a problem?)
From the msdn library I read:
DSum(expr, domain[, criteria])
expr - An expression that identifies the numeric field whose values you want to total. It can be a string expression identifying a field in a table or query, or . . . . .
domain - A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name.
Private Sub Form_Current()
Me!Text111 = DSum(ratio, rollbacks)
End Sub
yields the same result.
Private Sub Form_Current()
Text111 = Sum(ratio)
End Sub
gives me the error Sub function not defined.
I cannot for the life of me see what I am doing wrong!
Any help would be much apprreciated
Thanks, John