Greetings,
Could someone help me, trying to create a combo box within a datagrid so users so not have to type in all the time.
Thanks you in advance
Printable View
Greetings,
Could someone help me, trying to create a combo box within a datagrid so users so not have to type in all the time.
Thanks you in advance
Hi there, ok this an example of what i have been using..
It requires that the column that you want the list to appear under has it's button setting set to true, the rest should be pretty self explanitory, if you need any more info please reply again..
Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
Dim Co As Column
Set Co = DBGrid1.Columns(ColIndex)
'Position the listbox
List1.Left = DBGrid1.Left + Co.Left + Co.Width
List1.Top = DBGrid1.Top + DBGrid1.RowTop(DBGrid1.Row)
List1.Width = Co.Width
List1.Visible = True
List1.ZOrder 0
List1.SetFocus
End Sub
Private Sub Form_Load()
' add items to the list
List1.AddItem "On"
List1.ItemData(List1.NewIndex) = -1
List1.AddItem "Off"
List1.ItemData(List1.NewIndex) = 0
End Sub
Private Sub List1_Click()
DBGrid1.Columns("Current").Text = List1.ItemData(List1.ListIndex)
List1.Visible = False
End Sub
Piers