Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox in DBGrid 1

Status
Not open for further replies.

ZanfirMarin

Programmer
Aug 10, 2001
7
0
0
RO
Could I use a ComboBox in a DBGrid? How?
 
ya, u can use a individual combo box or list box in db grid control. here is a little code, which shows a dblist box in dbgrid control. put a dbgrid and dbcombo on a form and paste the following code and test. it may solve ur problem.

Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
If ColIndex = 0 Then
DBCombo1.Visible = True
DBCombo1.Left = DBGrid1.Left + DBGrid1.Columns(0).Left
DBCombo1.Top = DBGrid1.Top + (DBGrid1.RowHeight) * (DBGrid1.Row + 1)
DBCombo1.Width = DBGrid1.Columns(0).Width
DBCombo1.SetFocus
Exit Sub
End If
End Sub

Private Sub Form_Load()
DBGrid1.Columns(0).Button = True
End Sub

 
Thank you for your answer. It is an intersting clue but is pretty far from an Datasheet Access ComboBox.

Thanks again!
ZM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top