Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 8

Canceling User Changes Before They Are Saved (VB6)

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

See Also


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved