Results 1 to 3 of 3

Thread: Datagrid refresh and display refreshed data

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009

    Datagrid refresh and display refreshed data


    Please help me!

    I have VB 6.0 application which is used to extract lock information of a job if any of the user locks it. There is a possibility of a job getting locked in different ways. So when i click on get locks info, its displays the lock info of job in datagrid as below

    Job No | Job Type | Job Pid |Job user
    123 | A | 222 | Tom
    123 | A | 333 | Kat

    I am able to pull the above data successfully andnow my question is my application should allow user to select the required row and unlock it, after the unlock is successful, it should remove the row that was selected and display the refreshed datagrid.

    Please help me.


  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Bristol, UK

    Re: Datagrid refresh and display refreshed data

    Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'VB6 and earlier' forum

  3. #3
    Lively Member
    Join Date
    Oct 2011

    Smile Re: Datagrid refresh and display refreshed data

    Hi Mahesh,

    Assuming Your problem,

    1)First find display all the data available from a table on data grid
    Private Sub Form_Load()
    With grdAccount ' name of the grid 
        .ColWidth(0) = 100
        .ColWidth(1) = 100
        .ColWidth(2) = 100
        .ColWidth(3) = 100
    End With
    Call grd_Data_Loader
    End Sub
    'Code for grd_data_Loader
    Private Function grd_Data_Loader()
    rs.Open "Select*from tblAccount", cn, 3, 3
    Set grdAccount.DataSource = rs
    Set rs = Nothing
    End Function
    2) Select the row for which u want to unlock
    3) on select of the row call this function delete which will remove an entry from table
    4) Call the grd_Data_Loader function again

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width