private void btnGenerate_Click(object sender, EventArgs e) { if (studentSelected != null) { GeneratePermanentRec gpr = new GeneratePermanentRec(); gpr._studentID = studentSelected.StudentId; gpr.Show(); } }