Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    You have more than One problem, so let's go through them one at a time.

    You use this.

    Code:
    Private Sub Form_Current()
        
         Call CalcProduced
         Call CalcProduced1
         Call CalcProduced2
    End Sub
    This means that every time you open a Record you recalculate the values.



    Why?

  2. #17
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    I though it was the only way to do all of the calculations I needed. My values are based on values that are calcuated from other values. i.e

    value c requires value B and its value requires A

    Is there a better way?

    I am at the hospital right now.

    I am also using my cell to reply so till I get back home my responce will be slow so please stick with me

  3. #18
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    I trust you and your loved ones are well. Best wishes in that regard.

    Back to the subject.

    If the values have been calculated and stored, why do you need to recalculate.

    Do you actually need to store these values. Why not just calculate them on the fly. This way you could delete some of your fields and just calculate them as you need.

    This is entirely up to you but I would personally calculate them as I needed them.

  4. #19
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Next problem.

    You use the After Update event.

    Try using the Before Update Event. There are some good discussion on this so I suggest you google and read up on it.

  5. #20
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Next Problem

    What value are you calculating? The one in the Form or the one in the Table.

    They both have the same name so how do you tell Access the difference.

    Suggest you rename all of your Text boxes to txtNameOfField instead of simply NameOfField.

  6. #21
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    The code was created and added to the access database and uploaded so I could see how it worked in action. I understand for the most part how the code is calculating the values.

    Its the values that are calculated that are important to this database. I need to track the Jobs that our operators, the date they run them, how many machines they run, the hours earned per job & compare it the the standard run time hours. When we run the reports we want to be able to take a look at a job number like 321 and see if our operators are meeting the required goals.

    I to know I don't need to visually see the calculations. Its important that we be able to track these values calculated.

    Please let me know if I am clearly explaining the what & the why.

    Also what would I need to change to use the Before Update Event?

    Is there a better way to do what I need to do. I am a complete newbie with vb, I am currently reading everything on the subject that I can find so that I may better understand it.

    Did you get my message about issues with changing the tables from text values to number values. When I did this it caused my form to stop calculating and showing the values

  7. #22
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Will reply a little later.

  8. #23
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Thanks Rainlover

  9. #24
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Also I need to add to my last post about something you asked in an eariler post. "Why I needed to recalculate each time I open the form".

    Its not that I am recalculating the same values over and over. Each time I add a record to the data entry table I consider it a new record.

    I mean on Monday our operator may run 5 machines, on Tuesday thay may run 4 machines this fact alone changes our Standard Hours.

    We may run a Part on machine 5 on one day and machine 4. We want to compare the job that we run, the machines they run on, & the employee who runs the job so we may better track efficiency.

    If you looking at the form you will see that when you select a part number we have some default values automatically populated, while others are calculated. The calculated values will be different on from day to day.

    Lets say operator 1 who works first shift and runs part 321 on machine 4 and cuts 75 lengths.

    Then

    Operator 2 who works 2nd shift runs the same machine and only cuts 56 lengths. The values that are recorded will show that these 2 operators are not producing the same amount of lengths. With the reports we will generate we will be able to compare this data

    I hope this helps you understand why we are recording the calculated values.

  10. #25
    WhatnThe is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2009
    Posts
    50
    Quote Originally Posted by Rainlover View Post
    Will reply a little later.

    Have you had a chance to look further into my form. I am still searching Google to see I could see if anyone else as encountered the same things with no luck

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Getting rid of zeros
    By ceb39 in forum Reports
    Replies: 26
    Last Post: 05-31-2009, 12:49 PM
  2. leading 'Zeros' in data
    By wasim_sono in forum Forms
    Replies: 3
    Last Post: 04-06-2009, 11:57 AM
  3. Viewing ending zeros in decimal
    By duecesup in forum Reports
    Replies: 0
    Last Post: 12-11-2008, 02:45 PM
  4. Non programer needs help in decimal numbers
    By Peter O in forum Access
    Replies: 1
    Last Post: 10-07-2008, 12:29 PM
  5. Date Past Function
    By Laney in forum Access
    Replies: 4
    Last Post: 05-21-2008, 07:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums