Results 1 to 4 of 4
  1. #1
    BernardKane is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Jun 2006
    Location
    Lincolnshire
    Posts
    12

    Update table from calculated field in a form

    I have a simple database that records my hours worked and associated income against my hourly cost.



    I have two fields with derived data that calculates the overall time to do the job (=GetElapsedTime([Finish]-[Start])) and the value of the time calculated from value of hours and minutes (=([Hours]*[ValueHours])+([Minutes]*[ValueMinutes])). How do I get the results calulated to automatically update the table that houses the fields for these two derived pieces of information. At present I use SQL from an update quesry set in a macro but it is not very effective.

    Any help would be very much appreciated. I fairly new at this sort of thing so clear advice would be very gratefully recieved.

    Bernard Kane

  2. #2
    Join Date
    Jun 2005
    Location
    Northampton, England
    Posts
    14
    An update query is the way to go, but in all honesty, you should not put derived data in a table. It is considered bad practice, as you can always get the answers through a query. I would try to steer clear of macros anyway. You should trigger the calculation in either a form event or a control event, say behind a command button.

  3. #3
    BernardKane is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Jun 2006
    Location
    Lincolnshire
    Posts
    12

    Updating tables

    Thank you for that but I was hoping there was a way of coding an update to a table without using a query.

    Bernard

  4. #4
    Join Date
    Jun 2005
    Location
    Northampton, England
    Posts
    14
    You could use SQL?

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

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2013, 11:42 AM
  2. Calculated Query Field used in different Query
    By cakdhooper in forum Queries
    Replies: 0
    Last Post: 11-21-2008, 03:07 PM
  3. Setting criteria in a calculated date field
    By SteveReberger in forum Access
    Replies: 0
    Last Post: 10-29-2008, 06:58 AM
  4. Replies: 1
    Last Post: 08-04-2008, 03:30 AM
  5. Calculated Text Box Populating in Table
    By Debbie in forum Access
    Replies: 2
    Last Post: 11-13-2006, 08:02 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