akwasijulius
May 7th, 1999, 02:32 PM
I'm using the requery() to be able to update a formview after I have added records in another form.
The problem I'm getting is that the when I come back to the original form none of the move operations works.
There is the code for it. Please what I'm I doing wrong.
void CStockEntryView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
// TODO: Add your specialized code here and/or call the base class
if(bActivate)
{
CMainFrame* pMFrame = (CMainFrame*)GetParentFrame();
//CStockEntryView* pView = NULL;
if (pMFrame->m_CurrentViewID == ADDPRODUCT_VIEW)
{
m_pRs->Requery(adCmdUnknown);
RefreshBoundData(); //suppose to refersh the fields to the form
pMFrame->m_CurrentViewID = STOCKENTRY_VIEW; // assign this as the new current view
CFormView::OnInitialUpdate(); // calling the virtual OnInitialUpdate() to update the values in the form
}
}
CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}
The problem I'm getting is that the when I come back to the original form none of the move operations works.
There is the code for it. Please what I'm I doing wrong.
void CStockEntryView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
// TODO: Add your specialized code here and/or call the base class
if(bActivate)
{
CMainFrame* pMFrame = (CMainFrame*)GetParentFrame();
//CStockEntryView* pView = NULL;
if (pMFrame->m_CurrentViewID == ADDPRODUCT_VIEW)
{
m_pRs->Requery(adCmdUnknown);
RefreshBoundData(); //suppose to refersh the fields to the form
pMFrame->m_CurrentViewID = STOCKENTRY_VIEW; // assign this as the new current view
CFormView::OnInitialUpdate(); // calling the virtual OnInitialUpdate() to update the values in the form
}
}
CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}