Results 1 to 4 of 4
  1. #1
    bar891 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    20

    Red face Update textbox after looping through datasheet column

    I have a project with a task table and a task datasheet view. The task status column is a combo box with "Not Started", "In Progress", "Deferred", "Completed" in which the user changes as the tasks are completed.
    I also have a Project Form that has a Status text box on it.


    I need to be able to loop through the task status column and see if all the tasks are completed and then update the Project status text box with "Completed" or if all the tasks are not completed then to update the Project status with "Not Completed".
    I just don't know what or where the code should be. I have tried many combinations including macro but i am not experienced enough to work it out. Can someone please help me?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    Can you tell us what tables you have and how thet are related. What forms you have and which tables they are based on. A little of what the db is for.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    bar891 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    20
    It is a basic Project Management setup with a Project Table, Tasks Table, Employee Table. It has a Project form that has subforms of Tasks and Employees Assigned to it. You can have many tasks to a single project that have to be completed by a certain date. It has a summary page that lists all the projects that are current and the status that they are at. so i want to see on the summary page that if all the tasks are completed or not.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    All you need is a DCount for any tasks for that project which do not have a status = "Completed". No need to loop through the recordset.

    Your project summary page could have something like this as the control source for the status text box:

    =iif (Dcount("*","TaskTable","Project = " & me![projectID] & " And TaskStatus <> 'Completed' ") = 0 ,"Complete", "Not Complete")

    This assumes the Project ID is numeric. It marks the whole project as Not Complete if there are one or more incomplete tasks.

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

Similar Threads

  1. ADODB looping through and update help!
    By fluffyvampirekitten in forum Access
    Replies: 5
    Last Post: 01-11-2016, 10:33 AM
  2. Replies: 7
    Last Post: 01-01-2016, 11:17 PM
  3. Replies: 5
    Last Post: 04-30-2015, 01:50 AM
  4. Replies: 9
    Last Post: 01-31-2014, 12:09 PM
  5. Replies: 1
    Last Post: 12-08-2011, 08:03 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