Why are you using a Value List rather than a RowSourceType of Table/Query, and a RowSource property of :
SELECT ID, tekst FROM ch_pojemnik ORDER BY tekst;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I use a "Value List" as a source for ComboBox
pojemnik.RowSourceType = "Value List"
Dim pole2 As ADODB.Recordset
Set pole2 = New ADODB.Recordset
pole2.CursorLocation = adUseClient
pole2.Open "SELECT * FROM ch_pojemnik ORDER BY tekst;", Ryzyko, adOpenKeyset, adLockReadOnly
Do While Not pole2.EOF
pojemnik.AddItem pole2.Fields("ID").Value & ";" & pole2.Fields("tekst").Value
pole2.MoveNext
Loop
pole2.Close
Set pole2 = Nothing
Finally, the list does not contain a dozen records that are in the source table. When I am not sorting, there are also gaps but other records are missing. Number of records in table "ch_pojemnik" is quite small = 514.
What is the problem, is there any limit of value list???
I use that method of feeding other combobox'es from SQL/ADO and it works well.
Why are you using a Value List rather than a RowSourceType of Table/Query, and a RowSource property of :
SELECT ID, tekst FROM ch_pojemnik ORDER BY tekst;
Używam list wartości, bo korzystam z tabel SQL, które łączę w procedurze poprzez ADODB i użytkownika SQL. Nie mam więc dostępu do żadnych tabel. Dzięki temu każdy może widzieć dane z bazy SQL poprzez formularze. Ta metoda jest rewelacyjna, ale pierwszy raz mnie zawiodła przy dużych listach. Ominąłem już ten problem poprzez utworzenie tymczasowej lokalnej tabeli z danych pochodzących z SQL i podłączyłem źródło ComboBox jako tabela. Nie zauważyłem zwiększenia czasu otwierania formularza.