Trying to simulate click in Listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to simulate the user clicking an entry in a listbox. This is done in a separate form. When I need to do this I open the form with the listbox passing the line to be 'clicked' in openargs. Then in the onopen event I load the lisbox with just that line. This all works ok but as soon as I try to retrieve data from the line, I get the 'form not open or object not active' message. Is there any way around this. It seems odd I can load the listbox but not get its values back
This is all in the on open event of the form.
 
David said:
I need to simulate the user clicking an entry in a listbox. This is done
in a separate form. When I need to do this I open the form with the listbox
passing the line to be 'clicked' in openargs. Then in the onopen event I
load the lisbox with just that line. This all works ok but as soon as I try
to retrieve data from the line, I get the 'form not open or object not
active' message. Is there any way around this. It seems odd I can load the
listbox but not get its values back.
This is all in the on open event of the form.

All OpenArgs is is a public (global) string variable. Either call it, or
create your own global variable to hold the value. Recognize, of course,
that global variables are not to be overused, nor can they be used when the
code is in a shared front-end. They have a flaw in that their value tends to
get lost if there is an error in your code.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top