T
Tony Botelho
I have been trying to create a heirarchal combobox and
the ImageCombo control was suggested to me. The problem
I'm having is that no matter what I do to add items, it
continually stays blank. Is there something I'm missing?
Here's some basic code I was using just to get it loaded
(obviously not heirarchal at this time...) but I only end
up with a blank combobox (no text or image) can anyone
help me out?
Code:
Private Sub Form_Open(Cancel As Integer)
Dim mydb As Database
Dim myrs As Recordset
Dim imgBox As ComboItem
Dim imgCB As ImageCombo
Set mydb = CurrentDb
Set myrs = mydb.OpenRecordset("tbl_category",
dbOpenSnapshot)
Set imgCB = Forms!frm_Timeclock!ImageComboBox1.Object
'cycle through Category table and load the combobox
'with all the records using no indentation
myrs.MoveFirst
While Not myrs.EOF
Set imgBox = imgCB.ComboItems.Add(, , myrs!Category)
imgBox.Indentation = 0
myrs.MoveNext
Wend
myrs.Close
mydb.Close
Set myrs = Nothing
Set mydb = Nothing
End Sub
Thanks in advance,
Tony
the ImageCombo control was suggested to me. The problem
I'm having is that no matter what I do to add items, it
continually stays blank. Is there something I'm missing?
Here's some basic code I was using just to get it loaded
(obviously not heirarchal at this time...) but I only end
up with a blank combobox (no text or image) can anyone
help me out?
Code:
Private Sub Form_Open(Cancel As Integer)
Dim mydb As Database
Dim myrs As Recordset
Dim imgBox As ComboItem
Dim imgCB As ImageCombo
Set mydb = CurrentDb
Set myrs = mydb.OpenRecordset("tbl_category",
dbOpenSnapshot)
Set imgCB = Forms!frm_Timeclock!ImageComboBox1.Object
'cycle through Category table and load the combobox
'with all the records using no indentation
myrs.MoveFirst
While Not myrs.EOF
Set imgBox = imgCB.ComboItems.Add(, , myrs!Category)
imgBox.Indentation = 0
myrs.MoveNext
Wend
myrs.Close
mydb.Close
Set myrs = Nothing
Set mydb = Nothing
End Sub
Thanks in advance,
Tony