Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Loop through Tagged text boxes on form??

Loop through Tagged text boxes on form??

Loop through Tagged text boxes on form??

Hi... I'm new to access! Hopefully someone can help.

My DB has one table, Its not very big however I have roughly 50 fields in it.
32 of the fields are named x1, x2, x3, x4, ....x32(corresponding to 32 text boxes on my form)
I have Tagged each text box with "T". How would i work it so I can only get the average(or std_dev) of only the tagged text boxes that have a numeric value greater than 0.00???

I realize there are a few ways of doing this however im struggling with it. Here's what i think...
Loop through each text box, If greater than 0.00 then increment a count(say C) then at the end divide my total by (32 - C)?
Or should I do this from the Table instead of the form? through a query? or how could i phrase DAvg so the criteria would pick out the nonNull Tagged textbox values??
Please help!!!

RE: Loop through Tagged text boxes on form??

Just an idea....

What do those x1, x2, x3, x4, ....x32 represent?
Are all of them always filled in (do ALL of them have values)?

If not, you may want to re-think your DB design and go with:

ProjID    X_Value
2         123
2         50
2         75
3         456
3         765
3         2

This way getting an average of X_Values for ProjectID = 2 (or 3, or whatever) is simple by:
SELECT Average(X_Value) from tbl_Other WHERE ProjID = 2

Have fun.

---- Andy

RE: Loop through Tagged text boxes on form??

  I do not get it.  I have shown you several times how to do this, but do not understand why you won't just do it as I explained.  But bottom line is you normalize the data with a big union query, and the rest is trivial. Basically your data would end up in the format that Andy suggests and then you just would do something similar to his query. See previous answer
thread701-1653035: Changing average Query?!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close