M
mac
Dear All:
I had searched the forum. I can't find a solution exactly what i am looking
for. Home someone can help me here.
I have a main form and subform. When I select an ID in the main form it
displays the related records in the subform. My subform's view is Datasheet
view. No other views allowed. The subform has 3 fiedls (Member,Attendence,
Remarks). What I need is I want to check whether any data is changed in the
subform, If there is a change I want to prompt for a Save. But If I say NO
to the save, I want to discard the changes made. I tried Before update of
the SUBform, but it doesn't allow me to go to next record, it keep asking me
Do you want to save the record. Here is my code.. Any help highly
appreciated.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Do you want to save the changes?"
If Me.Dirty = True Then
strMsg = MsgBox(strMsg, vbQuestion + vbYesNo, "Meeting Attendance")
If strMsg = vbNo Then
Cancel = True
Exit Sub
End If
Else
MsgBox "Your form is not dirty"
End If
End Sub
I had searched the forum. I can't find a solution exactly what i am looking
for. Home someone can help me here.
I have a main form and subform. When I select an ID in the main form it
displays the related records in the subform. My subform's view is Datasheet
view. No other views allowed. The subform has 3 fiedls (Member,Attendence,
Remarks). What I need is I want to check whether any data is changed in the
subform, If there is a change I want to prompt for a Save. But If I say NO
to the save, I want to discard the changes made. I tried Before update of
the SUBform, but it doesn't allow me to go to next record, it keep asking me
Do you want to save the record. Here is my code.. Any help highly
appreciated.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Do you want to save the changes?"
If Me.Dirty = True Then
strMsg = MsgBox(strMsg, vbQuestion + vbYesNo, "Meeting Attendance")
If strMsg = vbNo Then
Cancel = True
Exit Sub
End If
Else
MsgBox "Your form is not dirty"
End If
End Sub