Originally Posted by
koushal.vv
I have faced this problem before....
just go to the menu right click on it ,
say add event handler, Add the ONUpdate
event handler. U will have to enable
Every menu, Sub Menu OnUpdate event handler.
Then its quite simple use the pCMdUI->enable()
method to enable / Disable menu depending upon the condition.
The other method is to create a pop up menu , where the
enabling and disabling of menus will be simpler.
Hope i have solved u r problem , if not reply back here 
I think I have already done that part and still it would not work. Below is the code to ensure that we are talking about the same part.
void CDeptView::OnSortManager()
{
Selected = "MANAGER"; // Selected is a variable
// Pulling out data from the access table
m_pSet->m_strSort="[Managers].[ManagerName]";
m_pSet->Requery();
m_pSet->MoveFirst();
UpdateData(FALSE);
}
void CDeptView::OnUpdateSortManager(CCmdUI *pCmdUI)
{
// Setting a check to the menu item but it doesn't work now as
it has sub menu items
pCmdUI->SetCheck(( m_SelectedSort == "MANAGER")? 1 : 0 );
// Bellow is the condition when I want the menu item and its
sub item to be disabled.
if(Selected == "drum" || Selected == "guitar" || Selected == "mic" || Selected == "computer" || Selected == "car" || Selected == "hockey" || Selected == "laptop" || Selected == "watch" )
{
pCmdUI->Enable(Sort == 1);
}
}
This is how I have my code and it doesn't work. In a menu bar I have Sort. Under Sort I have Manager. Under Manager I have 2 other menu items. Before having thoes 2 menu items, Manager worked with check mark as well as disabling. After having sub menu items it wont. Can anyone help me out with it.
Vicky