number entry text box

  • Thread starter Thread starter lane55
  • Start date Start date
L

lane55

I have a form with three text boxes. One is for number
entry when this field is updated current date is entered in
second text box. I am trying to make third text box a
formula that would total all numbers entered (=sum number
text box). For example on Monday the number 10 is entered.
On Wednesday the number 15. I am trying to have total text
box show 25. I have on double click the value in number
text box is cleared. Of course then the formula text box
also shows 0. Is it even possible to clear number text box
enter new number and add it to (saved) total text box? If
what I am trying to do is impossible for Access I will try
a different approach and not waste any more time beating a
dead formula. Thanks
 
I have a form with three text boxes. One is for number
entry when this field is updated current date is entered in
second text box. I am trying to make third text box a
formula that would total all numbers entered (=sum number
text box). For example on Monday the number 10 is entered.
On Wednesday the number 15. I am trying to have total text
box show 25. I have on double click the value in number
text box is cleared. Of course then the formula text box
also shows 0. Is it even possible to clear number text box
enter new number and add it to (saved) total text box? If
what I am trying to do is impossible for Access I will try
a different approach and not waste any more time beating a
dead formula. Thanks

What's the underlying Table structure? (That's much more critical than
the form, especially in a case like this!) The Total field *should
not exist* in your table, since its value can be and should be
calculated on the fly; after all, it will change whenever you add a
new record.

Without knowing your table structure I can't give the exact
expression, but I'd suggest setting the Control Source of the third
textbox to

=DSum("[number field name]", "[tablename]", "<criteria>")

where you use your own field and table names and a criterion which
would select just those records (for this week??) that you want to sum
over. There would (I assume) be a date-entered field in the table; to
get a criterion of all records since the previous Monday you can use a
<criteria> string like

"[DateEntered] >= #" & DateAdd("d", 1 - Weekday(Date(), vbMonday) &
"#")
 
Thank-you Your help got me back on the right path. I
appreciate you taking the time to answer my post. Lane55
-----Original Message-----
I have a form with three text boxes. One is for number
entry when this field is updated current date is entered in
second text box. I am trying to make third text box a
formula that would total all numbers entered (=sum number
text box). For example on Monday the number 10 is entered.
On Wednesday the number 15. I am trying to have total text
box show 25. I have on double click the value in number
text box is cleared. Of course then the formula text box
also shows 0. Is it even possible to clear number text box
enter new number and add it to (saved) total text box? If
what I am trying to do is impossible for Access I will try
a different approach and not waste any more time beating a
dead formula. Thanks

What's the underlying Table structure? (That's much more critical than
the form, especially in a case like this!) The Total field *should
not exist* in your table, since its value can be and should be
calculated on the fly; after all, it will change whenever you add a
new record.

Without knowing your table structure I can't give the exact
expression, but I'd suggest setting the Control Source of the third
textbox to

=DSum("[number field name]", "[tablename]", "<criteria>")

where you use your own field and table names and a criterion which
would select just those records (for this week??) that you want to sum
over. There would (I assume) be a date-entered field in the table; to
get a criterion of all records since the previous Monday you can use a
<criteria> string like

"[DateEntered] >= #" & DateAdd("d", 1 - Weekday(Date(), vbMonday) &
"#")



.
 
Back
Top