focus?

G

Guest

I have a listbox on a form. A textbox checks the content of the listbox and
returns two messages according to what is found. I'd like the message to
visible immediately on opening the form. I tried setting a step in an event
procedure on the form's On Open property. The event does a couple other
things: pops up a message box warning, and opens an append query. I added the
line Me.listbox.SetFocus. Now, that doesn't seem to be enough. When I open
the form, the listbox does appear to get the focus, but the message in the
textbox does not become visible until I actually click on the listbox.
Actually, the visible information in the listbox should result in exactly the
opposite messsage that is visible in the textbox, until I click in the
listbox. I notice that the list box then becomes highlighted (the background
and font colors "invert"?)...and no matter what else I click on it remains
that way.

Am I going about this all wrong? My listbox gets data from a query. My
textbox is supposed to display a message if the listbox is null, and the
value of the listbox in another message if there is a value (there are only
two options - a specific value or null). I'd like to hide the listbox and
just display the two optional messages.
 
C

Carl Rapson

You might try using Form_Load instead of Form_Open. Controls and record
sources aren't reliably initialized during the Form_Open event.

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top