Freetutes.com

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

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

Sponsored Links

Canceling User Changes Before They Are Saved

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

<< Previous | Contents | Next >>

 

 

Home | Link to Us | Partner Links | About Us | Contact Us
Copyright © 2007-2008 Freetutes.com | All Rights Reserved