BEGIN_MESSAGE_MAP(CSomeRecordSetView, CFormView)
ON_COMMAND(ID_RECORD_NEXT_MM, OnRecordNextMm)
END_MESSAGE_MAP()
void CSomeRecordSetView::OnRecordNextMm()
{
if (m_CurrentRecord < m_NumRecords - 1)
{
m_pSet->Open();
m_pSet->Move(++m_CurrentRecord);
DataExchange(m_pSet, TRUE);
UpdateData(FALSE);
m_pSet->Close();
}
}
DataExchange method (you have to write this) moves data from RecordSet to View (whan argument is TRUE) and vice versa (when argument is FALSE), e.g.
void CSomeRecordSetView::DataExchange(CSomeRecordSet *pSet, BOOL Direction)
{
if (Direction)
{
m_SomeData = m_pSet->m_SomeData;
}
else
{
m_pSet->m_SomeData = m_SomeData;
}
}
This, as far as I remember, replaces the default behaviour of RecordSet view Next button. Prev, First and Last are similar.