Results 1 to 6 of 6
  1. #1
    Lxmanager is offline Novice
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Posts
    24

    Multiplying Values from a form and table

    Hi, I have what is probably a simple problem.



    I have a form called frmInspSht linked to a table called tblInspSht. On the form I have two text boxes one called ReworkHrs and one called ReworkCost.

    I also have another table called tblFactoryDetails and within that table I have a field called HourRate with a value in it of 40.

    The operator fills in the form and enters a figure in the ReworkHrs text box, for example 5.

    What I need then is the database to multiply the ReworkHrs text box by the HourRate value in the tblFactoryDetails table and display the result in the ReworkCost text box on the form, at the same time populating its field in the tblInspSht.

    so when they enter 5 in the ReworkHrs text box the ReworkCost text box will show a value of 200 and both will be stored in the tbl.

    I know this is probably simple but I cannot figure it out. Please could someone help and show me how.

    Many Thanks, Andy

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How do you know what records to look at in the tblFactoryDetails table?

  3. #3
    Lxmanager is offline Novice
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Posts
    24
    Hi, I only have one record in the FactoryDetails table, that just holds things like factory name, address and variables like the one I am using. The value 40 is the man hours of the factory. The idea is if that changes I only have to change that table instead of trying to find where it is in the database.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So the AfterUpdate event of the ReworkHrs TextBox will have something like this in it:
    Me.ReworkCost = Me.ReworkHrs * DLookup("[HourRate]","tblFactoryDetails")

  5. #5
    Lxmanager is offline Novice
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Posts
    24
    Hi, it took a bit of jugling around but it is now working fine, thanks very much for your help.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Great! Are you ready to use the Thread Tools and mark this thread as Solved?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 02-19-2012, 03:48 PM
  2. Multiplying
    By chazcoral2 in forum Forms
    Replies: 16
    Last Post: 09-10-2010, 01:44 PM
  3. Replies: 2
    Last Post: 08-22-2010, 01:42 PM
  4. Display values in a FORM from table.
    By excelkeechak in forum Forms
    Replies: 3
    Last Post: 05-04-2010, 10:17 AM
  5. Replies: 3
    Last Post: 04-04-2010, 05:26 PM

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