Results 1 to 2 of 2

Thread: DataGrid runtime refresh. Help.

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Question

    Hi all,

    I have a DataGrid with ADODC on a form. Connecting to a SQL server database.

    I also have a combobox containing the table names that the user can select.

    What I want to do is form opens with blank DataGrid. User selects a table from the combobox, and it displays the table contect in the DataGrid.

    This is my code from the Click event of the combobox:

    ------------------------
    Private Sub cmb_dbtable_Click()

    Select Case cmb_dbtable.Text
    Case "Clients"
    Data1.RecordSource = "Clients"
    Case "Bills"
    Data1.RecordSource = "Bills"
    End Select

    Set DataGrid_dbtable.DataSource = Data1
    DataGrid_dbtable.ReBind

    End Sub
    -------------------------

    Ok. Form opens with blank DataGrid. User selects a table from combobox for the FIRST time. Connects to DB, and table is displayed in DataGrid. THIS WORKS FINE only on the FIRST time.

    After the DataGrid is populated, the next time user selects another table, the DataGrid does not refresh. It just stays with whatever is already in there. It seems that ReBind doesn't do anything.

    Please post clues, hints, or anything you can think of. I really appreciate it. Thank you.

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    48

    Talking Solved it myself

    Never mind...

    All I had to do was add Data1.Refresh.

    Thanks anyway.


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