If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Very Simple Access Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-27-12, 10:01
StanSandall StanSandall is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
Cool 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
Reply With Quote
  #2 (permalink)  
Old 01-27-12, 12:23
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
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!
Reply With Quote
  #3 (permalink)  
Old 01-27-12, 13:21
StanSandall StanSandall is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 01-27-12, 15:21
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
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!
Reply With Quote
  #5 (permalink)  
Old 01-27-12, 16:48
StanSandall StanSandall is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 01-27-12, 17:04
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
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!
Reply With Quote
  #7 (permalink)  
Old 01-27-12, 22:28
StanSandall StanSandall is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
Thanks

Thanks ... It works Great .... Tell next time ....
Reply With Quote
  #8 (permalink)  
Old 01-28-12, 00:44
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
Youre welcome!
__________________
Have a nice day!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On