passing value from database from one form to another form


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: passing value from database from one form to another form

  1. #1
    skyxmen Guest

    passing value from database from one form to another form


    Hi,

    i have a database program using adodc component and used datagrid to view
    all the extracted rows from one of the table from the database.

    my question is, how can i select one row from the datagrid and pass all the
    value of the selected row to another form which also has another adodc component,
    the other form is used to update the selected row from the first form. my
    problem is to keep the value of the selected row in the second form

    the first form is used to display list of values (using datagrid), and
    the second form is used to update the data from the selected row of the first
    form.



  2. #2
    G. Allen Guest

    Re: passing value from database from one form to another form


    Say Form2 is your update form then use:

    Dim lngID as long

    Public Property ID(lngNewValue As Long)
    lngID = lngNewValue
    ' Insert code to load other data to be displayed from the database.
    End Property

    If Form1 is the form with the grid then you can use:
    Form2.ID = lngID
    Form2.Show
    where lngID is the id number that you get from the grid.


    "skyxmen" <skyxmen@yahoo.com> wrote:
    >
    >Hi,
    >
    >i have a database program using adodc component and used datagrid to view



    >all the extracted rows from one of the table from the database.
    >
    >my question is, how can i select one row from the datagrid and pass all

    the
    >value of the selected row to another form which also has another adodc component,
    >the other form is used to update the selected row from the first form. my
    >problem is to keep the value of the selected row in the second form
    >
    >the first form is used to display list of values (using datagrid), and
    >the second form is used to update the data from the selected row of the

    first
    >form.
    >
    >



  3. #3
    Arthur Wood Guest

    Re: passing value from database from one form to another form


    G. Allen, and SkyXMen:

    Minor correction to the posted code:

    Public Property Let ID(lngNewValue As Long)
    ---


    Arthur Wood

    "G. Allen" <gallenspam@worldnet.att.net> wrote:
    >
    >Say Form2 is your update form then use:
    >
    >Dim lngID as long
    >
    >Public Property ID(lngNewValue As Long)
    > lngID = lngNewValue
    > ' Insert code to load other data to be displayed from the database.
    >End Property
    >
    >If Form1 is the form with the grid then you can use:
    > Form2.ID = lngID
    > Form2.Show
    >where lngID is the id number that you get from the grid.
    >
    >
    >"skyxmen" <skyxmen@yahoo.com> wrote:
    >>
    >>Hi,
    >>
    >>i have a database program using adodc component and used datagrid to view

    >
    >
    >>all the extracted rows from one of the table from the database.
    >>
    >>my question is, how can i select one row from the datagrid and pass all

    >the
    >>value of the selected row to another form which also has another adodc

    component,
    >>the other form is used to update the selected row from the first form.

    my
    >>problem is to keep the value of the selected row in the second form
    >>
    >>the first form is used to display list of values (using datagrid), and
    >>the second form is used to update the data from the selected row of the

    >first
    >>form.
    >>
    >>

    >



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