>I have a view that's being used as the RowSouce for a combobox. My problem is that the pointer location in the combobox doesn't match the record location in the view when I run this code.
>
>
>SELECT &lcView1Alias
>LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
>This.cboBox1.Value = &lcView1Alias..Name
>This.cboBox1.Refresh()
>LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
>
>
>The glitch is with the 3rd line of the code because &lcView1Alias.Name is not unique. If there are four 'names' that are the same, it always ends up on the first one once the 3rd line of code here is run, which is why the Locate is run again at the end. The problem is that now when a user clicks the downarrow on the combobox, it looks like they're sitting on the first 'name' instead of the one they selected. Anyone have any suggestions on how to fix this? (other than changing what cbobox1.value is? don't want to have to do that due to the amount of other code that would have to be changed).
>-thanks!
If rowsource is a view why are you playing with value. Just locate the record with unique key. You could even use the recno() as listindex :
LOCATE FOR &lcView1Alias..Key_id = &lcView2Alias..Key_Id
This.cboBox1.Listindex = recno()
Cetin