Link to home
Start Free TrialLog in
Avatar of hariprasadere
hariprasadere

asked on

receiving data from a datagrid control

hi i have two forms a and formb .In foram a am entering the data for employees.i have a button on the form a when i click it it shows form b and display the information of loacation in the data grid.what i am trying here is when i clikc any row on the datagrid,the value should be display in the form a

here is my code

in form b code
dim frmemployee as new frmemployee
frmemployee.txtlocationid.text=me.dgresults.item(me.dgresults.currentrowindex,0)


Avatar of Preece
Preece
Flag of United States of America image

I would use one form, with the edit fields at the top, and the datagrid below.  When you click an item in the datagrid control, then populate the edit fields.  Just be sure that if you were in the middle of an edit, to prompt for saving first before going to the new row and populating the edit fields, thus losing any unsaved info.  Also, when you create a new record or edit an existing one, once you click save, refresh the datagrid.

Preece
ASKER CERTIFIED SOLUTION
Avatar of Ariful Ambia
Ariful Ambia
Flag of Bangladesh image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial