[AccessD] Code help please

Joe Hecht jmhla at earthlink.net
Mon Apr 5 22:18:28 CDT 2004


This code is supposed to
1.       Confirm this is an existing record
2.       If the form is dirty 
 
Open a message box
 
I need vb yes. I want to go to the next record.
 
Can not find the right method
                        
 
Thanks  
 
Joe
 
 
 
Private Sub Form_Dirty(Cancel As Integer)
 
    if me.newrecord = false and
    If Me.Dirty Then
    Dim lngRetval As Long
 
    lngRetval = MsgBox( _
        "Data on this form has changed! " & vbCrLf & "" & vbCrLf & "Do
you wish to continue?", _
        vbYesNoCancel + vbQuestion + vbSystemModal + vbDefaultButton1, _
        "Data Has Changed")
 
    Select Case lngRetval
        Case vbYes
        
        Add New RECORD
            
        Case vbNo
         Forms!frmmasterAddresses!txtLastName.SetFocus
        
        
        
        Case vbCancel
        
           
            
    End Select
    
   End If
      
        
 
 
 
End Sub
 
 
 



More information about the AccessD mailing list