adding fields in form

  • Thread starter Furious Shepherd
  • Start date
F

Furious Shepherd

I've been trying to create a field that is the some of about 10 other fields
in one of my forms. I can't seem to get it. I've tried grouping all of the
fields as per the help screens. I run into trouble when I try to create an
unbound HTML control. The icon is greyed. I'm about at my wits end. anyone
know an easy was to accomplish this?

Thanks,
Furious
 
J

John Vinson

I've been trying to create a field that is the some of about 10 other fields
in one of my forms. I can't seem to get it. I've tried grouping all of the
fields as per the help screens. I run into trouble when I try to create an
unbound HTML control. The icon is greyed. I'm about at my wits end. anyone
know an easy was to accomplish this?

Thanks,
Furious

Is this an Access database Form? or a HTML form? It's doable either
way but the syntax is different.

What's the environment? the context?
 
F

Furious Shepherd

John Vinson said:
Is this an Access database Form? or a HTML form? It's doable either
way but the syntax is different.

What's the environment? the context?

John,

It is an Access form. I'm creating a database that I will use to store info
on winery visits. The field I'm trying to create is one that totals the
score (integer) of several other fields.

Kind regards,
Furious
 
J

John Vinson

It is an Access form. I'm creating a database that I will use to store info
on winery visits. The field I'm trying to create is one that totals the
score (integer) of several other fields.

Try setting the Control Source of a textbox to

= [txtScoreA] + [txtScoreB] + [txtScoreC]

where the values in the brackets are replaced with the name of the
form controls containing the values you're trying to sum.

Another way, often preferable, is to do the summing in the Query
underlying the form rather than on the Form itself: in a vacant Field
cell just type

TotalScore: [ScoreA] + [ScoreB] + [ScoreC]

using the fieldnames that you want to sum.

In any case, this total score should generally NOT be stored in the
table, period; since it can be derived from the other scores, it would
be redundant and subject to error (if you changed one of the
underlying scores the total would become incorrect).
 
R

Rolls

If the data you need to calculate the sum is stored in multiple records of a
table, you could build a query and return the result to a textbox on your
form. When your form changes Requery to update.

You could also build a query with a calculated field that would return the
sum as well as the other data, and use this query as the form's
RecordSource.

You could crossfoot several fields on the form:
txtTotal = txtItem1 + txtItem2 ... etc. where each txtBox is a textbox name
on your form. Go to each textbox, right-clich, Properties, Name and modify
the textbox name, then use it as a reference in your expression in the
textbox where you want to see the total. You can use the expression
builder or type the expression.
 
F

Furious Shepherd

John Vinson said:
It is an Access form. I'm creating a database that I will use to store info
on winery visits. The field I'm trying to create is one that totals the
score (integer) of several other fields.

Try setting the Control Source of a textbox to

= [txtScoreA] + [txtScoreB] + [txtScoreC]

where the values in the brackets are replaced with the name of the
form controls containing the values you're trying to sum.

Another way, often preferable, is to do the summing in the Query
underlying the form rather than on the Form itself: in a vacant Field
cell just type

TotalScore: [ScoreA] + [ScoreB] + [ScoreC]

using the fieldnames that you want to sum.

In any case, this total score should generally NOT be stored in the
table, period; since it can be derived from the other scores, it would
be redundant and subject to error (if you changed one of the
underlying scores the total would become incorrect).

John,

Thanks for your help. As it turns out, I was missing the initial "=" sign.
All set now.

Thanks,
Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top