Results 1 to 5 of 5
  1. #1
    tsn.s is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Location
    Selby, North Yorkshire, UK
    Posts
    19

    Automatic form field fill in

    Hi

    I have a field on a form called "Course Status". I am trying to get it to say either "Pass" or "Pending" depending on whether 4 other fields (Assessment 1 in, Assessment 2 In, Assessment 3 In and Assessment 4 In) say "Pass". I've managed to get "Course Status" to say "Pass" if the other 4 fields are set to "Pass" but I'm not entirely sure on how to get it to say "Pending" if they are not. I have placed the code under the 4 fields that "Pass" needs to be in. This is what I have so far:



    Code:
    Private Sub Assessment_1_Status_AfterUpdate()
    
    If Me.Assessment_1_Status = "Pass" And Me.Assessment_2_Status = "Pass" And Me.Assessment_3_Status = "Pass" And Me.Assessment_4_Status = "Pass" Then Me.Course_Status = "Pass"
    
    End Sub
    I hope this makes sense.

    Any help is much appreciated.

    Thanks

    tsn.s

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Hi

    You could try this:
    If Me.Assessment_1_Status = "Pass" And Me.Assessment_2_Status = "Pass" And Me.Assessment_3_Status = "Pass" And Me.Assessment_4_Status = "Pass" Then
    Me.Course_Status = "Pass"
    Else
    Me.Course_Status = "Pending"

    End If
    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
    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
    I think you need and ElseIf using the same test but with OR instead of AND.

  4. #4
    tsn.s is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Location
    Selby, North Yorkshire, UK
    Posts
    19
    Thanks for the help!

    I've tried both ways and booth work great.

    Cheers

    tsn.s

  5. #5
    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
    Post #2 does not guarantee that at least one of the elements is a "Pass" if that makes any difference.

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

Similar Threads

  1. Automatic Field DAta Entry
    By Lupson2011 in forum Access
    Replies: 4
    Last Post: 09-01-2011, 09:15 AM
  2. ComboBox to ComboBox automatic fill
    By vbjohn in forum Access
    Replies: 2
    Last Post: 08-18-2011, 01:35 PM
  3. Replies: 5
    Last Post: 01-20-2011, 11:36 PM
  4. Replies: 2
    Last Post: 09-20-2010, 09:02 PM
  5. Automatic field check and population
    By danidin in forum Forms
    Replies: 0
    Last Post: 01-03-2009, 12:45 PM

Tags for this Thread

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