private void btnSearch_Click(object sender, EventArgs e)
        {
            int intTemp;


            switch (((ComboBoxItem)cmbAddressType.SelectedItem).Value)
            {
            case CUSTOMERVALUE:
                frmCustomers objCustomersForm;


                objCustomersForm = new frmCustomers(txtNo.Text);
                objCustomersForm.ShowDialog();

                if (objCustomersForm.SelectedCustomerAddress != null)
                {
                    txtNo.Text = objCustomersForm.SelectedCustomerAddress.CustomerNumber;

                    if (int.TryParse(objCustomersForm.SelectedCustomerAddress.CustomerNumber, out intTemp))
                    {
                        mintCustomerOrVendorNumber = intTemp;
                    }
                    LoadCustomerAddresses();
                }
                break;

            case VENDORVALUE:
                frmVendors objVendorsForm;


                objVendorsForm = new frmVendors(txtNo.Text);
                objVendorsForm.ShowDialog();

                if (objVendorsForm.SelectedVendorAddress != null)
                {
                    txtNo.Text = objVendorsForm.SelectedVendorAddress.VendorNumber;

                    if (int.TryParse(objVendorsForm.SelectedVendorAddress.VendorNumber, out intTemp))
                    {
                        mintCustomerOrVendorNumber = intTemp;
                    }
                    LoadVendorAddresses();
                }
                break;
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            int intTemp;

            switch (((ComboBoxItem)cmbAddressType.SelectedItem).Value)
            {
                case CUSTOMERVALUE:
                    frmCustomers objCustomersForm;

                    objCustomersForm = new frmCustomers(txtNo.Text);
                    objCustomersForm.ShowDialog();

                    if (objCustomersForm.SelectedCustomerAddress != null)
                    {
                        txtNo.Text = objCustomersForm.SelectedCustomerAddress.CustomerNumber;

                        if (int.TryParse(objCustomersForm.SelectedCustomerAddress.CustomerNumber, out intTemp))
                            mintCustomerOrVendorNumber = intTemp;
                        LoadCustomerAddresses();
                    }
                    break;
                case VENDORVALUE:
                    frmVendors objVendorsForm;

                    objVendorsForm = new frmVendors(txtNo.Text);
                    objVendorsForm.ShowDialog();

                    if (objVendorsForm.SelectedVendorAddress != null)
                    {
                        txtNo.Text = objVendorsForm.SelectedVendorAddress.VendorNumber;

                        if (int.TryParse(objVendorsForm.SelectedVendorAddress.VendorNumber, out intTemp))
                            mintCustomerOrVendorNumber = intTemp;
                        LoadVendorAddresses();
                    }
                    break;
            }
        }