To cancel pending user edits to the current record in unbound screen controls,
you can call whatever procedure you have written to programmatically refresh controls
with the data from the current record.
This action will cause the controls to reflect the existing state of the field in
the record buffer, therefore overwriting any changes the user has made to controls.
The code for canceling user edits might look like Listing 8.7.
LISTING 8.7
CANCELING PENDING CHANGES
Private Sub cmdCancel_Click()
'Call General procedure to populate
'controls from current record
PlaceDataInControls
End Sub
Private Sub PlaceDataInControls
txtFirstName = rs!FirstName & ""
txtLastName = rs!LastName & ""
'and so on for each field
End Sub