Results 1 to 2 of 2

Thread: What's wrong with the rebind

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    US, PA
    Posts
    79

    What's wrong with the rebind

    I have a datagrid, an ADO control, a text box and a command button on a form.
    At run time. I pick either 1, 2 or 3 and the datagrid populates fine. I then put a value which is different from what I picked the first time, the datagrid doesn't rebind??? . What else should I be doing to change the value in the datagrid.

    This is what I wrote under the command button:

    Private Sub Command1_Click()
    If Text1 = 1 Then
    Adodc1.RecordSource = "TITLES"
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.ReBind
    ElseIf Text1 = 2 Then
    Adodc1.RecordSource = "AUTHORS"
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.ReBind
    ElseIf Text1 = 3 Then
    Adodc1.RecordSource = "[Title Author]"
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.ReBind
    End If

    End Sub

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    US, PA
    Posts
    79
    I figured it out.
    I had to write Adodc1.refresh after I changed the adodc1.recordsource. Now the Datagrid was rebinding fine.

    Reggie

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