strange behaviour button that opens zoombox

E

Eelco de Vries

Hi there!

I have a button on the details section of a continous form next to a
textfield, and in the onclick event I have the code

Private Sub btnVerdiepingZoom_Click()
Me.txtVerdieping.SetFocus
RunCommand acCmdZoomBox
End Sub

When I haven't clicked yet, the buttons each become yellow-edged when I
mouse-over them. When I do click, the text-field next to it gets focus and
opens the zoombox as expected.
When I close this zoombox, *all* the buttons next to all the textfields now
have this "mouse-over" look (orange-yellow edged).
How do I bring this buttons back to default state?
Tried with repaint, didn't work. Is there a "loose-focus" like there is a
"setfocus"?
 
A

Arvin Meyer MVP

I suggest using the Double-Click event and rewriting your code like this:

Private Sub txtVerdieping_DblClick(Cancel As Integer)
DoCmd.RunCommand acCmdZoomBox
End Sub
 
E

Eelco de Vries

Thanks for the quick answer, but the problem is that the customer doesn't get
the double-click. He needs to have a button to click, so it is obvious that
it zooms.
Otherwise he could just as easy use the F2-thingy... :)

--
Voer eendjes, geen oorlog


Arvin Meyer MVP said:
I suggest using the Double-Click event and rewriting your code like this:

Private Sub txtVerdieping_DblClick(Cancel As Integer)
DoCmd.RunCommand acCmdZoomBox
End Sub
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
A

Arvin Meyer MVP

There is a LostFocus event for command buttons which will solve your
problem, but remember, lost focus happens when another control is clicked,
not when the mouse is moved. You may have to use the MouseMove event of the
Detail section to force the focus to move to another control.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Eelco de Vries said:
Thanks for the quick answer, but the problem is that the customer doesn't
get
the double-click. He needs to have a button to click, so it is obvious
that
it zooms.
Otherwise he could just as easy use the F2-thingy... :)
 

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

Top