|
-
Jun 2nd, 2007, 09:05 AM
#1
Thread Starter
Lively Member
Can't Clear List In Datacombo!
Hello:
I have a datacombo3 that I can't clear the drop down list until I exit and reload the form.
Set DataCombo3.DataSource = Nothing
Set DataCombo3.RowSource = Nothing
It sill show the list from the last ado connection. Even after setting the Datasource & Rowsource to nothing and rebinding with the below statement.
This is a Blank DataBase
'*****************************************
Dim sql As String
sql = "Select * from Brand order by brand"
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = sql
Adodc3.Refresh
Set DataCombo3.DataSource = Adodc3
Set DataCombo3.RowSource = Adodc3.Recordset
DataCombo3.BoundColumn = "ID"
DataCombo3.ListField = "Brand"
DataCombo3.Text = DataCombo3.Text
DataCombo3.BoundText = DataCombo3.BoundText 'A trick to help
-
Jun 2nd, 2007, 09:33 AM
#2
Re: Can't Clear List In Datacombo!
Issues like this is just one of the reasons that very few people use bound controls.. for more, see this FAQ article.
I would recommend using code to connect to the database instead.. it is about the same amount of work for the simple things, and much less for the more complex things. It also avoids issues like this, as well as installation issues.. and more importantly, there are many more people here who can help you with it.
If you want to give it a try, see the ADO Tutorial link in my signature, and the ADO section of our Database FAQs for further things that can be done.
-
Jun 4th, 2007, 11:12 AM
#3
Thread Starter
Lively Member
Re: Can't Clear List In Datacombo!
Just wanted to say Thank You!
I did what you said and everything is working just fine.
-
Jun 4th, 2007, 11:37 AM
#4
Re: Can't Clear List In Datacombo!
Good stuff, I'm glad you got it sorted - thanks for letting us know. 
As you have the answer to your question (even tho it was probably more work than you wanted!), could you please do us a little favour, and mark this thread as Resolved?
(this saves time reading for those of us who like to answer questions, and also helps those who search to find answers)
You can do this by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved".
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
|