Monday 11 August 2014

FETCH RECORDS FROM ONE FORM TO ANOTHER FORM THROUGH MENUITEMBUTTON

We have to follow some steps,

Step 1:
Create one Table with some Fields .Then add this table into form(HistoryForm1) as a datasource.Drag and Drop the fields into design.



Step 2:
Create another one table with some fields.Here Also add this table into form(HistoryForm2) as a datasource.Drag and Drop the fields into design.

Step 3:
Now create one MenuItemButton(NextForm) into the Form B.

Step 4:
Now We want to fetch the records from Form A to Form B.so we want to write code under datasource level in FormA.



 Write the code in validatewrite() method:


public boolean validateWrite()
{

boolean ret;
LinkTable2 linkTable2;


ret = super();
linkTable2.RollNo=TaskAddDelete.IdNumber;

linkTable2.StudentName=TaskAddDelete.StudentName;

linkTable2.insert();


return ret;


}

 Step 5:
Now we insert some records in HistoryForm1 and Click that Button(NextForm) HistoryForm2 will be opened with Same Records as HistoryForm1 .

No comments:

Post a Comment