Re: Select record on listbox click

Tech-Archive recommends: Speed Up your PC by fixing your registry




"Mirage" <Win_XP_User@xxxxxxxxxxx> wrote in message
news:1113541200.277731.14160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thanks Mark, I got the answer from the code you posted. It was easier
> than I thought, I was just unsure on how to use the NewIndex. Thanks
> for the help!

Glad to help! :-) In testing it I realized that my first suggestion was
incomplete, that the bookmark needed to be coerced to a double (which may
not be the case for all providers, btw.)

In case you're interested, I determined this (after getting a
parameter-related error) in the debugger by calling VarType, passing
rs.Bookmark as it's parameter: I did the same thing to my stored copy of
the bookmark in ItemData.

[In the Immediate window of the debugger]

?VarType(rs.Bookmark)
(returned 5)

?VarType(List1.ItemData(List1.ListIndex))
(returned 3)

vbDouble is defined as 5, vbLong as 3, so from there I deduced that it was a
type issue, and coerced my stored copy back to its original type... shezam!

But Bookmark is technically a variant, and so could be any type the provider
wants it to be...

Just so you know...


-Mark


.