Hi Guys. I have a form that can successfully access a MySQL database. I have two DataCombo's on this form. They are both set up in the same way but to access a different column in the database.
The first DataCombo has a name called DateUpdate. The datasource has a value of Adodc1 (also has the control or what ever you all it on the form). The DataField is set to the column I want. The DataFormat is set to the format I want. However, when I run the form, ONLY the first entry in the database is placed into the DataCombo, nothing after that. The test database has two entries for testing. The second entry does not go in.
This is the same for the other DataCombo on the form. Of course, each DataCombo has a different name. And is set in the same way but to access a different column.
But when I added the following, the form doesn't come up, just shows the error message below and then the app closes
VB Code:
Do While Not rs.EOF
DateUpdate.AddItem rs(0)
rs.MoveNext
Loop
Do While Not rs.EOF
TimeUpdate.AddItem rs(0)
rs.MoveNext
Loop
Which I found on a thread in here a moment ago and was given the following error message:
Oh, thought you were using a ComboBox, which has the additem property. I see that a datacombo is a bound (evil) control
If you insist, though, here is an excerpt:
In the Properties window, set the properties of the DataCombo control as shown in the table below.Property Setting
Name dcbSuppliers
DataSource adoDataSource
DataField SupplierID
RowSource adoRowSource
ListField CompanyName
BoundColumn SupplierID
Fifth from the top, on the left, next to the listbox. That will simplify things greatly! Set it to drop-down, and set the text to a message like "Choose Time"
Fifth from the top, on the left, next to the listbox. That will simplify things greatly! Set it to drop-down, and set the text to a message like "Choose Time"
Replaced DataCombo with ComboBox now.
Both are set to 0 - Dropdown Combo
The one called DateDelete has a message of Choose Date
The one called TimeDelete has a message of Choose Time
DateDelete is going to house the dates
TimeDelete is going to house the times
The code you enclosed also doesnt work with mysql by what i can tell but when i did it, it added 0-100 in both of them. just have to modify to work with records.
Last edited by BrailleSchool; Oct 1st, 2005 at 12:35 AM.