Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Quote Originally Posted by ssanfu View Post


    I am TOTALLY lost!
    In Post #19 you show what you want to happen - there are 7 examples.


    Now you change and say

    But in the examples 3, 4 & 5, you show Fail Email even when the last Status is "Pass"!!!
    Attachment 29515

    Do you want to use/check only the last 3 or 10 (if there are that many inspections)??
    But again, your table "Inspection" has no field to sort by other than the autonumber field, which is an extremely poor choice. You need a Test or Inspection date/time, an Inspection number (like an invoice number),... something!

    The purpose of an AutoNumber field is to provide a unique value that serves no other purpose than to make each record unique. It is only guaranteed to unique, NOT sequential, nor increasing positive (meaning it can go negative).
    Hi Steve,

    Sorry to confused you. The table is showing what i wish to get.
    But the fact is not..
    When the result is PASS - FAIL - PASS , it should not send me the FAIL email when the last result is PASS.
    But the fact is, it still send me FAIL email when the last result is PASS.
    What i want also is each time fail, it will send me 1 FAIL email.

    EDIT: Allow me to elaborate more. (PASS - FAIL - PASS)
    1) PASS - NO ACTION and count as Pass = 1 (Do not need to send me email
    2) FAIL - Send me FAIL email.
    3) PASS - No action and count as Pass = 1. (Do not send me FAIL EMAIL as it is pass)

  2. #32
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If you have FAIL - FAIL -FAIL you should get 3 emails???

  3. #33
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Quote Originally Posted by ssanfu View Post
    If you have FAIL - FAIL -FAIL you should get 3 emails???
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL
    For date - 19 July - FAIL - Send me 1 FAIL Email
    For date - 20 July - FAIL - Send me 1 FAIL email.

    Or let's say if 18 July I inspect 3 lots.
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL . When the result FAIL - send me 1 FAIL email.
    For date - 18 July - FAIL - Send me 1 FAIL Email
    For date - 18 July - FAIL - Send me 1 FAIL email.

  4. #34
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Or let's say if 18 July I inspect 3 lots.
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL . When the result FAIL - send me 1 FAIL email.
    For date - 18 July - FAIL - Send me 1 FAIL Email
    For date - 18 July - FAIL - Send me 1 FAIL email.
    For 18 July, you want
    Case 1
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL
    For date - 18 July - FAIL - Send me 1 FAIL Email
    For date - 18 July - FAIL - Send me 1 FAIL email.

    1 email per 18 July fail??

    OR

    Case 2
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL
    For date - 18 July - FAIL -
    For date - 18 July - FAIL -

    1 email for 18 July fail??



    Your table structure has changed? (There is a date field?)
    Can you post a table with test data???

  5. #35
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110
    Quote Originally Posted by ssanfu View Post
    For 18 July, you want
    Case 1
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL
    For date - 18 July - FAIL - Send me 1 FAIL Email
    For date - 18 July - FAIL - Send me 1 FAIL email.

    1 email per 18 July fail??

    OR

    Case 2
    For date - 18 July - FAIL - Send me 1 FAIL EMAIL
    For date - 18 July - FAIL -
    For date - 18 July - FAIL -

    1 email for 18 July fail??



    Your table structure has changed? (There is a date field?)
    Can you post a table with test data???
    Hi Steve,

    I didn't input the datecode. Still the same, just an example for you. Look at the code itself.

    Code:
    With rst
    
    Do Until .EOF
    
    
    If (![Status] = "Pass") Then
    PassCount = PassCount + 1
    Else
    .MoveLast
    PassCount = 0
    Call Email3                   ' << If my result is Pass - FAIL - Pass, it will send me FAIL email. Because it screen thru the whole data.Once we have fail data, 
                                               it will send me FAIL EMAIL. 
    
    
    End If
    .MoveNext
    Loop
    End With
    
    
    If (PassCount >= 3) Then
    MsgBox ("Product Number: " & PartNumber & " " & cmbID & " has more than 3 Pass!")
    
    
    
    
    Call Update
    Call Email2
    
    
    
    
    End If
    
    
    End Function

  6. #36
    onlylonely is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    May 2017
    Posts
    110

    Post

    Hi Steve,

    Plase have alook.

    Part number : 111
    Attached Files Attached Files
    Last edited by onlylonely; 07-18-2017 at 09:05 PM. Reason: Look at function CheckPass()

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 06-06-2017, 01:43 PM
  2. Replies: 9
    Last Post: 03-07-2017, 02:49 PM
  3. Replies: 12
    Last Post: 06-05-2015, 04:27 PM
  4. Loop issue
    By dragon_sun252 in forum Programming
    Replies: 25
    Last Post: 04-29-2012, 12:27 AM
  5. Issue with while loop and Access 2007 datasheet
    By jermaine123 in forum Programming
    Replies: 2
    Last Post: 01-17-2010, 10:09 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