-
I use a random to select one item in a listbox. Then I
access a database with this item. But this (database access)
only works, when I press a button (like space) or click on
the item again. Is there a function so that I don't need to click on it again ?
Is there a function which works like clicking on an
item in a listbox ???
Code:
''''''My random, 'L1 = Listbox
A = L1.ListCount
Randomize
MyRand = Int(A * Rnd)
L1.ListIndex = MyRand
L1.SetFocus
[i] !! VB 3.0 !! Matt-D(eutschland) :) ;)
[Edited by Matt-D on 11-03-2000 at 12:16 PM]
-
hmmm.. don't really get your problem, but if nothing else helps try SendKeys "{space}"
but this is a real crappy way so try to explain your prob better so we'll can help you better
-
You can call the method you use to acces the database, for example:
''''''My random, 'L1 = Listbox
A = L1.ListCount
Randomize
MyRand = Int(A * Rnd)
L1.ListIndex = MyRand
L1.SetFocus
call L1_LostFocus 'or the event when you acces to database
-
I think that's the problem:
List1.Selected(MyRand) = True
Instead of
L1.ListIndex = MyRand
-
Is there a function which works like clicking on an
item in a listbox ???
You could always do
Call List1_Click()
but if you really want to click you need the api...
-
[b] Problem Solved
I forgot come code - doh
: INP2.Text = L1
But thanks