Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2011
    Location
    Louisville, KY
    Posts
    7

    Automatically update field

    Running Access 07'



    Building a QA database and my form has 5 fields, each with 2 values (Pass & Fail)

    I would like to have a form automatically fill in a 6th field with a pass or fail value based on the other five. If none of the 5 are fails then it will report a passed audit, if one or more of the 5 categories are fails than it will report a fail.

    I know I can throw in the field for our auditors to complete, but I'd rather have it do it automatically as a fail safe.

    Can I do this?

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    In an event for a field (or on every Pass/Fail) field, you could add some vba code like such:

    if me.Field1.value = "Pass" and me.Field2.value = "Pass" and me.Field3.value = "Pass" and me.Field4.value = "Pass" and me.Field5.value = "Pass" then me.OtherField.value = "Pass" else me.OtherField.value = "Fail"

    and you could have this code in each of Field1 through Field5 afterupdate events.

  3. #3
    Join Date
    Feb 2011
    Location
    Louisville, KY
    Posts
    7
    Access tells me that it cant find the object if me.

  4. #4
    SteveH2508 is offline Competent Performer
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Chelsea, London, England
    Posts
    117
    In a text box put the following expression as the control source

    (untested aircode) assuming your Fields are Yes/No fields

    =IIf(Abs([Field1]+[Field2]+[Field3]+[Field4]+[Field5])=5,"Pass","Fail")

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

Similar Threads

  1. How to update fields automatically
    By kosan in forum Forms
    Replies: 1
    Last Post: 09-10-2010, 04:49 PM
  2. Replies: 5
    Last Post: 08-20-2010, 06:40 AM
  3. Automatically update datasheet
    By tammiep in forum Forms
    Replies: 1
    Last Post: 08-17-2010, 04:43 PM
  4. Help Automatically running and Update Query
    By JohnRandolphSTL in forum Queries
    Replies: 8
    Last Post: 04-13-2010, 02:08 PM
  5. Replies: 4
    Last Post: 05-19-2009, 04:15 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