adding fields in form

  • Thread starter Thread starter Furious Shepherd
  • Start date 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
 
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?
 
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
 
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).
 
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.
 
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
 
Back
Top