Hi Pete,
the control must have the focus when you set the ListIndex prop.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"(PeteCresswell)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Per (PeteCresswell):
>>Seems like I've done it before - and Help seems to indicates it's possible
>>from
>>VBA, but on this one it's throwing an error:
>>--------------------------------------------------------------
>>?[forms]![frmDeal]![lstTrancheTradeDates].BoundColumn
>> 0
>>
>>?[forms]![frmDeal]![lstTrancheTradeDates].listcount
>> 1
>>
>>[forms]![frmDeal]![lstTrancheTradeDates].listindex = 0
>>("Error 7777 You've used the listindex property incorrectly")
>>--------------------------------------------------------------
>
> Reading/taking the Help example more literally, I can work around it with:
> -------------------
> [forms]![frmDeal]![lstTrancheTradeDates].Setfocus
> [forms]![frmDeal]![lstTrancheTradeDates].listindex = 0
> -------------------
>
> But that doesn't get it for this particular app because the listbox is
> buried in a page on a tab control - and if the right page isn't already
> selected, the .Setfocus traps out. I can't coerce the page because that
> would create consternation in the user.
>
> It *Still* seems like I've done this in the past with no problems and no
> .Select
> beforehand...
> --
> PeteCresswell