private int validateUpdate()
	{
		try
	    {
			int receiptID;
		    int upc;
		    int quantity;

		if (piReceiptID.getText().trim().length() != 0 && isNumeric(piReceiptID.getText().trim()))
		{
		    receiptID = Integer.valueOf(piReceiptID.getText().trim()).intValue();
		} else {
			return VALIDATIONERROR;
		}

		if (itemUPC.getText().trim().length() != 0 && isNumeric(piReceiptID.getText().trim()))
		{
		    upc = Integer.valueOf(itemUPC.getText().trim()).intValue();
		 
		    // check if purchaseItem exists
		    if (!purchaseItem.findPurchaseItem(receiptID, upc))
		    {
		    	Toolkit.getDefaultToolkit().beep();
		    	mvb.updateStatusBar("PurchaseItem (" + receiptID + "," + upc + ") does not exist!");
		    	return OPERATIONFAILED; 
		    }
		}
		else
		{
		    return VALIDATIONERROR; 
		}

		if (itemQuantity.getText().trim().length() != 0 && isNumeric(itemQuantity.getText().trim()))
		{
		    quantity = Integer.valueOf(itemQuantity.getText().trim()).intValue();
		}
		else
		{
		    return VALIDATIONERROR; 
		}
		
		mvb.updateStatusBar("Updating purchaseItem...");

		if (purchaseItem.updatePurchaseItem(receiptID, upc, quantity))
		{
		    mvb.updateStatusBar("Operation successful.");
		    showAllPurchaseItems();
		    return OPERATIONSUCCESS; 
		}
		else
		{
		    Toolkit.getDefaultToolkit().beep();
		    mvb.updateStatusBar("Operation failed.");
		    return OPERATIONFAILED; 
		}
	    }
	    catch (NumberFormatException ex)
	    {
		// this exception is thrown when a string 
		// cannot be converted to a number
		return VALIDATIONERROR; 
	    }
	}