Open a form with details of the selected record in the datagrid


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Open a form with details of the selected record in the datagrid

  1. #1
    LORENZONI Guest

    Open a form with details of the selected record in the datagrid


    I want to be able to click on one of the records displayed in my DATAGRID
    and pass that information to ANOTHER form that lists the full record information.
    How would I do it? I'm interested to the code I need to determine the record
    I want. My datagrid is bound to a dataset containing 2 relationed tables.
    In the detail form I want to show all data (master record fields and relationed
    fields into a datagrid). I need detail form to enable user to modify data.



  2. #2
    zac Guest

    Re: Open a form with details of the selected record in the datagrid


    you have to use the click or double click event of the grid.
    then in your code you would perform the following:
    frmMaster
    rstEmployee (example of recordset)
    DataGrid is control of Grid located on frmMaster
    frmDetail (form Detail)
    OBJECTIVE - a datagrid exists on frmMaster and it is on the form (frmMaster).
    You have a recordset that you populate the datagrid with. You want to click
    or double click on a row in the datagrid located on frmMaster and populate
    controls on form frmDetail.

    this takes advantage of the fields collection

    sub datagrid_click()
    frmDetail.txtFname = rstemployee.fields("Fname")
    frmDetail.txtLname = rstemployee.fields("Lname")
    frmDetail.txtID = rstemployee.fields("ID")
    frmDetail.txtDept = rstemployee.fields("Dept")
    end sub


    "LORENZONI" <2ellesoft@virgilio.it> wrote:
    >
    >I want to be able to click on one of the records displayed in my DATAGRID
    >and pass that information to ANOTHER form that lists the full record information.
    >How would I do it? I'm interested to the code I need to determine the record
    >I want. My datagrid is bound to a dataset containing 2 relationed tables.
    >In the detail form I want to show all data (master record fields and relationed
    >fields into a datagrid). I need detail form to enable user to modify data.
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center