Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Cool Unanswered: Very Simple Access Question

    Hello ....
    I want to add a simple statement to the statement below to test if field [Recorded Call Report] = False

    If [Recorded_Call_report ] = False, then skip the statment below and exit

    If [Recorded_Call_report ] = True, The run the statement below.

    ================================================== =======

    Private Sub Notes_Exit(Cancel As Integer)
    On Error GoTo Err_Command4596_Click
    DoCmd.SetWarnings False

    If MsgBox("Rosie ask....Do you want me to keep this record as all ready recorded is Siebel?", vbYesNo, "") = vbYes Then
    Me.Recorded_Call_report = True
    End If
    DoCmd.SetWarnings True

    Exit_Command4596_Click:
    Exit Sub

    Err_Command4596_Click:
    MsgBox Err.Description
    Resume Exit_Command4596_Click

    End Sub

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by StanSandall View Post
    I want to add a simple statement to the statement below to test if field [Recorded Call Report] = False

    If [Recorded_Call_report ] = False, then skip the statment below and exit

    If [Recorded_Call_report ] = True, The run the statement below.
    Which statement below and below which line in the procedure?
    Have a nice day!

  3. #3
    Join Date
    Jan 2012
    Posts
    4

    Thanks!

    I have this enbeded in a form so that when this field is "updated" this code runs ... I want the code now to test first ....If [Recorded_Call_report ] = True (this is on the same form), Then run the statement below, otherwise if "False" just exit the procedure or do not run

    -------------------------------------------------------------------------


    If MsgBox("Rosie ask....Do you want me to keep this record as all ready recorded is Siebel?", vbYesNo, "") = vbYes Then
    Me.Recorded_Call_report = True

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try:
    Code:
    Private Sub Notes_Exit(Cancel As Integer)
    
        On Error GoTo Err_Command4596_Click
    
        If Me.Recorded_Call_report.Value = True Then
            DoCmd.SetWarnings False
            If MsgBox("Rosie ask....Do you want me to keep this record as all ready recorded is Siebel?", vbYesNo, "") = vbYes Then
                Me.Recorded_Call_report = True
            End If
            DoCmd.SetWarnings True
        End If
    
    Exit_Command4596_Click:
        Exit Sub
    
    Err_Command4596_Click:
        MsgBox Err.Description
        Resume Exit_Command4596_Click
    
    End Sub
    However, there seems to be a discrepancy between 'Notes_Exit' and 'Command4596_Click'.
    Have a nice day!

  5. #5
    Join Date
    Jan 2012
    Posts
    4

    Thanks

    I removed

    On Error GoTo Err_Command4596_Click

    And the procedure runs fine ... so thanks for having me remove that statement.

    Any Ideas how to add the check for the [Recorded_Call_report ] = True

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by StanSandall View Post
    Any Ideas how to add the check for the [Recorded_Call_report ] = True
    I did it already:
    Code:
    Private Sub Notes_Exit(Cancel As Integer)
    
        On Error GoTo Err_Command4596_Click
    
        If Me.Recorded_Call_report.Value = True Then
            DoCmd.SetWarnings False
            If MsgBox("Rosie ask....Do you want me to keep this record as all ready recorded is Siebel?", vbYesNo, "") = vbYes Then
                Me.Recorded_Call_report = True
            End If
            DoCmd.SetWarnings True
        End If
    
    Exit_Command4596_Click:
        Exit Sub
    
    Err_Command4596_Click:
        MsgBox Err.Description
        Resume Exit_Command4596_Click
    
    End Sub
    Have a nice day!

  7. #7
    Join Date
    Jan 2012
    Posts
    4

    Thanks

    Thanks ... It works Great .... Tell next time ....

  8. #8
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Youre welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •