Access Continues Forms (1 Viewer)

Pleasure

Registered User.
Local time
Today, 21:20
Joined
Jul 26, 2005
Messages
44
Hello from Greece.
I have a little problem. Let's say I have a Tubular (Continues) Form with these Textboxes (assigned to fields in a Table Customers) :

SerialNo Name Date_Of_Birth Value
1 Theodore 9/12/76 5
2 Theodore 9/5/70 6
3 John 4/4/90 3
4 Maria 7/4/90 2
5 Anna 12/5/05 3

Then I apply filters (By right clicking and filter by selection). Let's say multiple filters for Name and Date_Of_Birth.

Is there any possible way, after the filtering, to have the Sum of the Value of each record (filtered Continues form) in a seperate textbox?

Thank a lot ...
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:20
Joined
Feb 19, 2002
Messages
43,371
If you add a footer to the form, you can put a control in it that sums the value field:

=Sum(ValueField)

PS "Value" is the name of a property and you will have difficultity with this as a name if you need to use VBA.
 

Pleasure

Registered User.
Local time
Today, 21:20
Joined
Jul 26, 2005
Messages
44
Well I tried that. Actualy I created a Textbox and applyed as Value this

=Sum([The Number Field])

But nothing happend. I' m sure the syntax is ok. I don't know, maybe you can help out with this.
Then I figured something else: To move to the first record of the form, focus on the textbox I want to sum and take the value to a variable. Then move to the next record (with a for - next loop) and do the same etc until i reach the last record.

This works but is very slow. If I have too many record in my Form this method is not the appropriate.

Any help - Comments - suggestions ??
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:20
Joined
Feb 19, 2002
Messages
43,371
My method WORKS and it is not slow. Did you add a FOOTER to the form? The control needs to go in the FOOTER section of the form.

PS if your field's name is actually "Value" that in itself could cause problems since Value is a property and the use of property or function names as data names frequently causes trouble in VBA.
 

boblarson

Smeghead
Local time
Today, 11:20
Joined
Jan 12, 2001
Messages
32,059
Also make sure that the text box that you are using is not named the same as a field in your form. The text box should be named something like "txtMyValue" if you have a field in the recordsource of the form that has the name "MyValue." (those names just made up as an example).
 

Pleasure

Registered User.
Local time
Today, 21:20
Joined
Jul 26, 2005
Messages
44
I did not set the Forms Footer. Now it's working nice. Thanks a lot my friends. You helped me a lot.
 

Users who are viewing this thread

Top Bottom