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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox in a Grid PROBLEM

Status
Not open for further replies.

tsm

Programmer
Nov 7, 2000
9
GR
I have 2 tables ( Sales and Customers ).
I put in a grid the fields code, custcode of table Sales. The field custcode of Sales is combobox in the grid and it has relation with the custcode of customers.
The combobox controlsource is sales.custcode, rowsourcetype is alias, rowsource is table customers.

Tabel customers has 3 records :

recno custcode custname
1 1 customer 1
2 2 customer 2
3 4 customer 3

The problem is that i choose the custcode 4 in the combobox.
When the combobox lost focus the fields data on the grid is now 3 not 4.
when i go again on that field in the grid it gets again 4.
I don't know what happens maybe it takes the recno.
How can i solve this problem.
I try this in a combo without a grid and it works fine.
Does anybody knows what happends ?
Thanks Michael
 

Have you tried setting the sparce propety?

oGrid.oColumn.sparse = .F. &&use currentcontrol for all cells


Pete
blindpete@mail.com

What your mother told you is true! You will go blind! (from moonshine anyway)
 
Hi TSM,

Try the following for the combo box,

BoundTo = .T.
BoundColumn = 2
RowSourceType = 6- Fields
ColumnCount = 1 (which is the default)

ControlSource = Sales.custCode
RowSource = Customer.custname,custcode

Hopes this helps.

Yue-Jeen

 
First thanks to all for your answers.
I tried all 3 answers and only Creeder's helps me.The data now in the table sales is ok when i choose a customer from the combobox but it displays only the perigr at the list of the combo. Anyway thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top