oForm = Createobject('comboingrid') oForm.Show Read Events Define Class comboingrid As Form Top = 0 Left = 0 Height = 371 Width = 728 DoCreate = .T. Caption = "Form1" Name = "Form1" DataSession=2 Add Object grdorditems As Grid With ; ColumnCount = 5, ; Height = 267, ; Left = 59, ; Top = 33, ; Width = 613, ; RecordSource = "orditems", ; RowHeight = 27, ; Name = "grdOrditems" Procedure Load Use orditems Endproc Procedure Init With This.grdorditems.Column3 .Width = 170 .Sparse = .F. .AddObject('myCombo','myCombo') .myCombo.Visible = .T. .CurrentControl = 'myCombo' Endwith Endproc Procedure QueryUnload Clear Events Endproc Enddefine Define Class myCombo As ComboBox BoundColumn = 3 ColumnCount = 3 ColumnWidths = "100,100,0" RowSourceType = 3 RowSource = "select prod_name,eng_name,product_id"+; " from products into cursor crsTemp" ControlSource = "Orditems.Product_id" FirstElement = 1 Height = 24 Left = 156 NumberOfElements = 0 Style = 2 Top = 312 Width = 180 Name = "Combo1" Procedure KeyPress Lparameters nKeyCode, nShiftAltCtrl If nKeyCode = 24 And !Eof() Nodefault Skip Endif If nKeyCode = 5 And !Bof() Nodefault Skip -1 Endif Endproc EnddefineCetin