Retreive values from row in Datagrid

Posted on 2006-04-04
Last Modified: 2010-05-01
I have one datagrid  and   textboxes namely student name, student Id and student add, student visit date.
Now   the user say enters either of the value in text boxes.............
based on that, i am  displaying the search in datagrid...
Now i want that when the user  selects any of the rows from datagrid , the values   will be displayed in the text boxes ( as i have mentioned  above)

 and  at the same  the search results remain in the  datagrid.. since this provides the user that he can select any other rows also......

Please  tell  me  in VB urgently
Question by:rajender123
    LVL 4

    Expert Comment

    display thecontent of datagrid values to text box
    text1.text= datagrid1.columns(0).text
    text2.text= datagrid1.columns(1).text


    Author Comment

    Thanks  abdul...
    but if th value is null in the datagrid it is showing the Type mismatch error...
    how will i  get that value  that this is null/../..
    how will i retreive that value..

    please let me know
    LVL 4

    Accepted Solution

    ok you can put on error resume next

    private sub B1_click ()
    on error resume next
    text1.text= datagrid1.columns(0).text
    text2.text= datagrid1.columns(1).text
    end sub
    so you can put the error resume on the top of sub

    Author Comment

    Thanks my problem is solved now...

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now