I am trying to add a security module to my database application and what actually I am trying to do is whenever I click on Logon button, it exits the login form and opens the main form depending on the role of user. 
I have the following code:

**LOGIN FORM:**

```
public void Login()
    {
        frmCommissionReport _commReport = new frmCommissionReport();

        if (_commission.Login(cbxLoginName, txbPassword))
        {
            MessageBox.Show("Successfull");
             // close this form - do not exit the application
            frmCommissionReport frm = new frmCommissionReport();
            this.Close();
            frm.ShowDialog();

        }
        else
        {

            MessageBox.Show("Username or Password not recognised");

        }

    }

    private void btnLogin_Click(object sender, EventArgs e)
    {
        Login();

    }

```

> 
> **MAIN FORM (frmCommissionReport)**
> 
> 
> 

```
public frmCommissionReport()
    {

        InitializeComponent();

        _login.ShowDialog();

    }

```

> 
> But for some reasons whenever I fill in the login details and click Login Button, it again opens the same Login Form and keeps on duplicating the login form whenever I click Login Button rather than redirecting me to Main Form
> 
> 
> 

![enter image description here](https://i.stack.imgur.com/iK9b1.png)