void OnLeavePartnerKey(object sender, EventArgs e)
        {
            if (FsuppressChangeEvent > 0)
            {
                return;
            }

            Control PrevFocus = FPetraUtilsObject.GetFocusedControl(this);

            if (PrevFocus == null)
            {
                PrevFocus = txtNewPartnerKey;
            }

            String PartnerKeySt = txtPartnerKey.Text;

            if (PartnerKeySt == "")
            {
/*
 *              MessageBox.Show("Error: Please enter a PartnerKey.",
 *                  "ESR Defaults", MessageBoxButtons.OK, MessageBoxIcon.Error);
 *              txtPartnerKey.Text = FselectedRow["a_partner_key_n"].ToString();
 *              txtPartnerKey.Focus();
 */
                return;
            }

            Int64   PartnerKey;
            Boolean IsNumeric = Int64.TryParse(PartnerKeySt, out PartnerKey);

            if (!IsNumeric)
            {
                MessageBox.Show("Error: Please check your entry for PartnerKey.",
                                "ESR Defaults", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPartnerKey.Text = FselectedRow["a_partner_key_n"].ToString();
                txtPartnerKey.Focus();
                return;
            }

            //
            // If the user didn't change the value,
            // there's nothing more to do here.

            if ((FselectedRow == null) || ((FselectedRow["a_new_partner_key_n"] != System.DBNull.Value) &&
                                           (Convert.ToInt64(FselectedRow["a_partner_key_n"]) == PartnerKey)))
            {
                return;
            }

            FesrDefaults.DefaultView.Sort = "a_partner_key_n";  // I don't know why I need to do this, since it was done previously in
                                                                // InitializeManualCode. But without it, I'm seeing exceptions here.

            if (FesrDefaults.DefaultView.Find(PartnerKey) > 0)
            {
                MessageBox.Show(String.Format("Error: An entry already exists for partner key {0}.", PartnerKeySt),
                                "ESR Defaults", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPartnerKey.Text = FselectedRow["a_partner_key_n"].ToString();
                txtPartnerKey.Focus();

                return;
            }

            if (txtNewPartnerKey.Text == "0000000000")
            {
                txtNewPartnerKey.Text = txtPartnerKey.Text;
            }

            UpdateGrid(sender, e);

            FsuppressChangeEvent++;
            // Since the Primary Key could have changed,
            // I need to re-select the correct row in the grid:
            Int32 NewRowPos = FesrDefaults.DefaultView.Find(PartnerKey);

            grdDetails.SelectRowInGrid(1 + NewRowPos, true); // This ends up calling back here!
            PrevFocus.Focus();
            FsuppressChangeEvent--;
        }