Results 1 to 2 of 2
  1. #1
    Bill Neilsen is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2014
    Location
    Perth
    Posts
    3

    Update Table issue

    Hi guys,
    I expect most will frown on what I need to do, but, trust me I need to do it.
    I have a master table that has the details of work orders (vehicle servicing), and the relevant fields are [ID], [JobNumber], [Vehicle] and [Totalmanhours].
    The child table has the details of individual tasks to be carried out on the vehicle and the manhours required for each task.
    The relationship is one to many, so I can have multiple tasks linked to the job number.


    Now, what I need to do is, calculate the total manpower for all the tasks linked to the job number which is obviously on the master table, and then update the master table [Totalmanhours] with this total, eg Job number - 0050, Vehicle - Holden 1234, tasks to be done - radiator flush- 5 hrs, oil change - .5 hrs, gearbox overhaul 25 hrs. I could then have the job number total calculated to be 30.5 hrs.
    There is another table with the manpower available by date, so, the reason I need to do it like this is to enable me to have reports for each day showing the all the vehicles booked in showing Vehicle, Job Number and Total manpower, without showing the individual tasks.
    I intend to have a report showing the days manpower available, and a linked subreport with all the individual vehicles job manpower requirements. This will then enable me to calculate on the main form any short fall or not of manpower.

    Can anyone help please?
    Access 2007

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Is there any reason you need to keep the [totalmanhours] data in the table? From your description of your requirements, you don't need to - the result you want can be achieved with a Totals query, in which the [totalmanhours] is a calculated SUM field. A totals query can be used almost anywhere a table can be used, especially on reports.

    Your requirement (or ones like it) is common, but as I said it is best resolved with a totals query.

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

Similar Threads

  1. Issue with update query
    By Magnolia1 in forum Queries
    Replies: 13
    Last Post: 08-27-2016, 02:07 PM
  2. Subform update issue
    By RayMilhon in forum Forms
    Replies: 3
    Last Post: 01-21-2016, 06:49 PM
  3. SQL statement UPDATE table issue
    By gori1084 in forum Forms
    Replies: 15
    Last Post: 06-11-2014, 08:45 AM
  4. Replies: 6
    Last Post: 04-03-2014, 02:02 PM
  5. Update query issue
    By doomy304 in forum Queries
    Replies: 2
    Last Post: 06-25-2011, 02:31 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