>>Hi all,
>>
>>I have a table of customer info (cust. no, name, address, etc). I have created a lookup form with an incremental search combo box (RowSource=Cust_Ship_To.custno,custname and RowSourceType=6), text boxes for the name and address stuff. Then I added two option buttons designed to change the index order of the table (Ship To and Name).
>>
>>In the InteractiveChange event for the combo box, I have Thisform.refresh().
>>
>>In the Click event for the buttons, I have
>>
>>*****BUTTON 1
>>Set order to custno
>>go top
>>ThisForm.combo2.ColumnWidths="62,190"
>>ThisForm.combo2.RowSource=Cust_Ship_To.custno,custname
>>ThisForm.Refresh()
>>ThisForm.combo2.SetFocus()
>>
>>*****BUTTON 2
>>Set order to custname
>>go top
>>ThisForm.combo2.ColumnWidths="190,62"
>>ThisForm.combo2.RowSource=Cust_Ship_To.custname,custno
>>ThisForm.Refresh()
>>ThisForm.combo2.SetFocus()
>>
>>Here is the catch....when I select one of the option buttons, the table is reordered, the pointer moves to the top of the indexed table and the text boxes fill with the right information. But the *% combo box does not move to the top of the indexed table??
>>
>>The combo box, when used alone, works fine.
>>
>>Any thoughts??
>>TIA,
>
>After you change Combo.Rowrource, don't forget to issue Combo.Requery
Thanks. I had forgotten it. After adding the combo.requery, the text boxes and combo box move together, but that has unearthed one more problem.
The data environment opens the table and the initial (custno) index. The form is presented with the first record of the indexed table showing. If I press the "Customer name" option button, it reorders the table and presents the right info.
However, if I move throught the table using the combo box, when I switch to the customer name index, the pointer is the same number of records from the top of that table as it was from the top of the custno table!
The click event of the option button is now:
SET ORDER TO TAG custno
GO TOP
THISFORM.combo2.COLUMNWIDTHS="62,190"
THISFORM.combo2.ROWSOURCE="Customer_Ship_To.custno,custname"
THISFORM.combo2.REQUERY()
THISFORM.REFRESH()
THISFORM.combo2.SETFOCUS()
Why is the pointer not being moved to the top of the re-ordered table when the option button is selected?
TIA,
Phil Thomas
http://phillipdthomas.comNever let your energy or enthusiasm be dampened by the discouragements that must inevitably come.....