I have forgotten how to perform this function. I need to display only the records that meet the following criteria: I only want to show records that have a quantity greater than 100. Can someone help?

This is an MFC project using an ODBC database:

void CInventoryView::OnRecordQuantity() 
{
	// TODO: Add your command handler code here
 
 
	m_pSet->Close();
	m_pSet->m_strFilter = "Quantity";
	m_pSet->Open();
	int iQuantity = m_pSet->GetRecordCount();
		if (iQuantity > 100) {
			AfxMessageBox("No matching records found.");
			m_pSet->Close();
			m_pSet->m_strFilter = "[Quantity]";
			m_pSet->Open();
		}
		UpdateData(FALSE);

<< moderator edit: added

tags >>

Are you dealing with a List control, array, or something else?

If its an array, you should be able to go through the array with a simple loop.

*I think*
If its a list control you can use the SortListA() function to return an array with specified data attributes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.