Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    textbox - form (2002)

    I want to create a textbox that will calculate the sum of the numbers in another textbox and then store that total in a total field in another table. I know how to code the textbox to add the numbers =sum(scores), but how do I get it to store that number in the control source field (totalscore) for that textbox.
    Or do I have to create one textbox to produce the total and then copy that total to my totalscore textbox. If so how do I copy the number from one field to another.

    Thanks

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: textbox - form (2002)

    In general, it is not a good idea to store calculated values in a table, because a) it is derived information that can be retrieved from the original data, so it is superfluous, and [img]/forums/images/smilies/cool.gif[/img] you run the risk that the stored value is not updated correctly.

    If you really need to store the total, you could create an update query and run it, or you could use the After Update event of each field that contributes to the total, or the Before Update event of the form as a whole to set the value of the totalscore field.

  3. #3
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: textbox - form (2002)

    I think that I undestand what you are saying; but there are times when I have a subform that updates one table. But I want certain fields from each record to be entered into a second table; would you create an update query to update the second table?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: textbox - form (2002)

    I don't know enough about your setup.

  5. #5
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: textbox - form (2002)

    Should I continue here or begin with a new post item.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: textbox - form (2002)

    If your question is not a direct follow-up to <!profile=paulbien>paulbien<!/profile>'s one, it is probably better to start a new thread, detailing your situation.

  7. #7
    2 Star Lounger
    Join Date
    Jul 2003
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: textbox - form (2002)

    Thank You; I think I will.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •