// JP opened flex table

Click to See Complete Forum and Search --> : In CMyRecordView How can I update the last changed record ?


Dmitry
July 16th, 1998, 01:53 AM
Data from CMyRecordView edit controls are updated only

when I move through my recordset or call

CRecordSet::UpdateData(). How can I update the last

changed record when user have to close the application

and don't want to move through recordset more ?

I don't want to use additional button "update" !

Using UpdateData() in CMyRecordView::~CMyRecordView()

is too late and it doesn't work.

Where and how can I do it ??

Thanks very mach.

Bob Dunlop
August 13th, 1998, 12:43 PM
Dmitry,


You need to intercept the WM_DESTROY when the user closes the view. At that point you still should be able to call UpdateData(). Also, you will probably want to add some way to test if the data has changed. So you might want to add an "IsDirty" flag to the view and then set that flag appropriately when the user changes data and when you call UpdateData().


Bob

Dmitry
August 14th, 1998, 01:01 AM
Thank you, Bob. I try it. It works!

But only


void CTmpRecordView::OnDestroy()

{

CRecordView::OnDestroy();

//m_pSet->Edit(); doesn't work here (does nothing)

//UpdateData(); doesn't work here (does nothing)

OnMove(ID_RECORD_PREV); //update works only with Move !!!Enigma!!!

}

//JP added flex table