0

I have two forms for submitting a skill update request.

Form 1: Is the request form, it contains a datagridview binded by a datatable (not binded to the database)

Form 2: The skills form, contains a datagridview control binded to my database, it lists all the skills.

What I want to happen is go be able to click add on form 1, open form 2 select a skill there and then when I click ok, skill details are transferred to form1. I can do it only once. I want to be able to send multiple skills in one request so the previous data must not be erased, however it does not happen because Form 2 opens another instance of the form every time.

Form.Activate() and Form.Show and Form.Update does not work. Help?

Open form2 link in form 1 to open form with list of skills.

private void AddSkills_Btn_Click(object sender, EventArgs e)
{
  AddSkill SkillsForm = new AddSkill();
  SkillsForm.Show();

From form2 (after selecting which skill the user wants to request)

 SkillUpdateRequest SUpdateReq = new SkillUpdateRequest();

 SUpdateReq.FName_txt.Text = fname;
 SUpdateReq.EmpID_Txt.Text = EmpID;
 SUpdateReq.MName_Txt.Text = mname;
 SUpdateReq.LName_Txt.Text = lname;
 SUpdateReq.EmpInitials_Txt.Text = LoggedUser;
 SUpdateReq.Position_Txt.Text = PositionName;

 SUpdateReq.SkillID_Txt.Text = SkillID;
 SUpdateReq.SkillName_Txt.Text = SkillName;
 SUpdateReq.SkillDescription_Txt.Text = SkillDesc;
 SUpdateReq.DateSubmitted_Txt.Text = DateTime.Now.ToString();

 SUpdateReq.GetEmpID(EmpID);
 SUpdateReq.Update();
 this.Close();
LarsTech
  • 80,625
  • 14
  • 153
  • 225
Ritzel
  • 33
  • 2
  • 4
  • 9
  • I think you can add sent data to the data grid view in a new row. So If you update again then your new row is added to datagridview. So you can retrive multiple data. – progrrammer Jan 14 '12 at 20:44

1 Answers1

0

Without knowing the exact data types, lists, data table, whatever you are trying to pass between forms, these prior posts might help

One link, multiple form passing back and forth data / control

Another that even samples method calling to go back and forth with data / actions

Community
  • 1
  • 1
DRapp
  • 47,638
  • 12
  • 72
  • 142