Results 1 to 8 of 8

Thread: [RESOLVED] Calculation problem!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Resolved [RESOLVED] Calculation problem!

    Hello All,

    I was going through a simple calculation program that I wrote not to long ago and just found a glitch in it.

    What happens it that when a certain textbox gets focus, then a mini form will pop up that the user will use to make a calculation.

    Once the user enters the numbers and hits calculate, then he clicks submit to send the info back to the main form. This works great.

    The problem is this: when the user clears the main form for another calculation and when the mini form pops up; the user will enter numbers in again like he did the first time, but when he hits calculate the figures actually totals not only the new numbers, but the last cleared numbers as well.

    Anyone know what is going on?

    I have attached my project. When you get to the pop sales, then the mini form will appear. Enter some numbers, then hit submit. Now hit clear and start over and see how the pop calculator will add the numbers from before with the new numbers.
    Attached Files Attached Files

  2. #2

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Re: Calculation problem!

    Oops!

    I try and see what happened

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Re: Calculation problem!

    I hope I got it this time.

    Its like the program is storing the previous calculation in memory and not releasing it when the form unloads.
    Attached Files Attached Files
    Last edited by cfd33; Jan 20th, 2007 at 03:41 PM.

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Calculation problem!

    I haven't loaded your new version but if you are depending on Unload to reset form variables it doesn't. In order for that to happen you have to set the form to Nothing. Is that the problem?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Re: Calculation problem!

    Hmmm, that might be it. I will give that a try.

    Something like this:

    frmPop = Nothing
    Last edited by cfd33; Jan 20th, 2007 at 05:03 PM.

  7. #7

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2006
    Posts
    449

    Re: Calculation problem!

    Martin,

    Thanks first of all for taking the time to help me.

    Yes, I think that did the trick. I'm going to go over a few more times to make sure.

    Thanks again!

Posting Permissions

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



Click Here to Expand Forum to Full Width