list box with value list in lieu of a bunch of buttons

  • Thread starter Thread starter Richard Hollenbeck
  • Start date Start date
R

Richard Hollenbeck

my project is for a visually impaired client. She has a hard time seeing
the gray command buttons but can see a list box just fine. So I made a list
box. All the code behind the column of buttons I put into a big Select Case
statement inside the Enter event of the list box. then the sub
lstMenu_DblClick(Cancel as Integer) just goes to the lstMenu_Enter sub. It
seems to work, but it's a buggy. I need to click here and there and
everywhere to make the stupid thing work correctly. Maybe I should just
make an easy-to-see image which looks something like a column of buttons and
put "hot spots" in the image to handle clicks. Can I simply download a
generic button somewhere that can handle text labels? Or maybe I can make a
generic button in PhotoShop and put a different label over each button.
Such a hassle. Any ideas?
 
Just a thought:

Maybe your client is having a hard time picking up the
grey buttons on the background of grey. How about
changing the backgroud color of the form?

Or, you could use Hyperlinks.


Chris Nebinger
 
The forms' backgrounds are white. Thanks for the idea. I started to make
custom buttons with a bitmap under a label. It's very tedious. I think
I'll try the hyperlinks. Sounds like a good idea. Thanks.
 
First, why don't you have the code all in the double click event? If you have
the code in the Enter event, and also call it from the double click event then
the code is going to try to run twice.

Once for the Enter event and then again for the double click event.
 
Yeah, I think that is a problem. That adds to it's bugginess. I'm thinking
about flexibility. If the user is scrolling with the up and down arrows
then presses "Enter" she will expect something to happen. When a single
"click" is the event it also responds to scrolling. I don't want "up arrow
button" or "down arrow button" to be an actionable event. I call Enter from
Double Click because I don't really understand the double click event; it
takes "Cancel as Integer." as an argument. But there is another problem.
If something else is already clicked and I click something else, it can
sometimes be interpreted by Access as a double click on the first item.
Wierd. I was thinking about taking the advice of another reply to this post
and simply make these all hyperlinks. But I don't know how to do it. I
have the "Big Book" so I can look into it. I'm still considering other
options.

But the clearest answer to your question is that I don't know how to call a
DblClick event from the Enter event's code. The double click is looking for
the argument "Cancel as Integer." I don't really understand what it wants.
But, if I have all the code in the Enter event, the DblClick event can
simply send the user to the Enter event's code. But you're right. The code
is running twice and very klunky--doesn't work very well at all.

Thanks.
 
What version of Access are you using? It's easier in 2003
then in 2000. I don't remember about XP.

In 2003, a label should have a IsHyperlink property. Set
it to True, then capture the OnClick event.

Chris Nebinger
 
So if you want to call the same code from different events, you would normally
make it a separate procedure (function or sub) and call it when needed.

So in that case, your user could double click on an item and it calls the
private sub you've added. Or you can call the sub with from the listbox Change
event or ...
 
Back
Top