How Can i display a record from my datagrid on my form


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How Can i display a record from my datagrid on my form

  1. #1
    Nelson Guest

    How Can i display a record from my datagrid on my form


    Hi Folks,

    How can I display a record i double clicked on my datagrid on another underlying
    form.

    Thanks all your anticipated help.



  2. #2
    Jim Guest

    Re: How Can i display a record from my datagrid on my form


    "Nelson" <jbamisaye@yahoo.com> wrote:
    >
    >Hi Folks,
    >
    >How can I display a record i double clicked on my datagrid on another underlying
    >form.
    >
    >Thanks all your anticipated help.
    >
    >

    '*******************************************
    If your database is opened on the form load then this would work:

    rstStud1.Open "SELECT field1, field2, field3 FROM Database
    WHERE Field = '" & txtSong.Text & "'", conn, adOpenStatic, adLockOptimistic

    Set DataGrid1.DataSource = rstStud1

    All you have to do is select the fields on the form to fill in from the database
    and this should work. If your database is not opened on the form load then
    you'll have to connect to it before you run this. Let us know if you still
    have problems.

    Jim

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