|
-
Nov 2nd, 2000, 02:36 PM
#1
Thread Starter
Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|