Mouse Move event not working on Switchboard

J

Jeff Conrad

Hi,

Using Access 97 here.
I'm getting strange results with trying to use a Mouse
Move event on the built-in Access Switchboard Manager.
I have tried on four different computers with three
different operating systems and getting mixed results.

Basically all I want to do is have the fore color of the
labels on the Switchboard change as the mouse is passed
over them for visual effect.

Steps to reproduce:
1. Create a new blank database.
2. Launch the Switchboard Manager and have it create a
form and table.
3. In the Wizard just create some dummy options so you'll
have more than one label appear when the form opens.
4. Change the Fore Color of each label to 6184448.
5. In the MouseMove event of the DETAIL section use this
code:

Dim i As Integer
On Error Resume Next
For i = 1 To 8
Me("OptionLabel" & i).ForeColor = 6184448
If Err <> 0 Then
Err.Clear
Exit For
End If
Next i

6. In EACH MouseMove event of the individual labels use
code like this:

Me.OptionLabel1.ForeColor = 16777215

Change the control name of course for each label.

The BEST result I've seen is ONLY the first label changing
color as I move the mouse around! Sometimes nothing
changes! I've even tried various coding options, but still
only the first label changes color. I've even tried to
move the mouse around really slowly, but no difference. I
also tried changing the fore color of each label in Design
View to either color and same result.

I even tried this code instead in the Detail MouseMove
event:

Me.OptionLabel1.ForeColor = 6184448
Me.OptionLabel2.ForeColor = 6184448
Me.OptionLabel3.ForeColor = 6184448
Me.OptionLabel4.ForeColor = 6184448
Me.OptionLabel5.ForeColor = 6184448
Me.OptionLabel6.ForeColor = 6184448
Me.OptionLabel7.ForeColor = 6184448
Me.OptionLabel8.ForeColor = 6184448

No change at all.

Does the same thing happen for you?
Am I coding this wrong? (more likely)

Thanks for any help,
Jeff Conrad
Bend, Oregon
 
D

Dirk Goldgar

Jeff Conrad said:
Hi,

Using Access 97 here.
I'm getting strange results with trying to use a Mouse
Move event on the built-in Access Switchboard Manager.
I have tried on four different computers with three
different operating systems and getting mixed results.

Basically all I want to do is have the fore color of the
labels on the Switchboard change as the mouse is passed
over them for visual effect.

Steps to reproduce:
1. Create a new blank database.
2. Launch the Switchboard Manager and have it create a
form and table.
3. In the Wizard just create some dummy options so you'll
have more than one label appear when the form opens.
4. Change the Fore Color of each label to 6184448.
5. In the MouseMove event of the DETAIL section use this
code:

Dim i As Integer
On Error Resume Next
For i = 1 To 8
Me("OptionLabel" & i).ForeColor = 6184448
If Err <> 0 Then
Err.Clear
Exit For
End If
Next i

6. In EACH MouseMove event of the individual labels use
code like this:

Me.OptionLabel1.ForeColor = 16777215

Change the control name of course for each label.

The BEST result I've seen is ONLY the first label changing
color as I move the mouse around! Sometimes nothing
changes! I've even tried various coding options, but still
only the first label changes color. I've even tried to
move the mouse around really slowly, but no difference. I
also tried changing the fore color of each label in Design
View to either color and same result.

I even tried this code instead in the Detail MouseMove
event:

Me.OptionLabel1.ForeColor = 6184448
Me.OptionLabel2.ForeColor = 6184448
Me.OptionLabel3.ForeColor = 6184448
Me.OptionLabel4.ForeColor = 6184448
Me.OptionLabel5.ForeColor = 6184448
Me.OptionLabel6.ForeColor = 6184448
Me.OptionLabel7.ForeColor = 6184448
Me.OptionLabel8.ForeColor = 6184448

No change at all.

Does the same thing happen for you?
Am I coding this wrong? (more likely)

Thanks for any help,
Jeff Conrad
Bend, Oregon

Jeff -

See this note in the help entry for MouseMove:

<quote>
This event doesn't apply to a label attached to another control, such as
the label for a text box. It applies only to "freestanding" labels.
Moving the mouse pointer over an attached label has the same effect as
moving the pointer over the associated control. The normal events for
the control occur; no separate events occur for the attached label.
</quote>

As created by the Switchboard Manager, the labels are attached to the
command buttons. I find that if I select all the labels, cut them from
the form, then paste them back (repositioning them as a group is easy)
and reset their OnMouseMove event properties to "[Event Procedure]", it
works properly. Or, even better, use the MouseMove events of the
buttons themselves instead of the labels -- then you can leave the
labels attached and the labels will highlight when you mouse over either
the labels or the buttons.
 
J

Jeff Conrad

Hi Yoda!

Well I'll be darned!!
Disconnecting the labels was just the trick.
Where the heck did you find that information, I've been battling this for
two days?!

Perfect as usual, thanks Yoda!
Jeff Conrad
Bend, Oregon

Dirk Goldgar said:
Jeff Conrad said:
Hi,

Using Access 97 here.
I'm getting strange results with trying to use a Mouse
Move event on the built-in Access Switchboard Manager.
I have tried on four different computers with three
different operating systems and getting mixed results.

Basically all I want to do is have the fore color of the
labels on the Switchboard change as the mouse is passed
over them for visual effect.

Steps to reproduce:
1. Create a new blank database.
2. Launch the Switchboard Manager and have it create a
form and table.
3. In the Wizard just create some dummy options so you'll
have more than one label appear when the form opens.
4. Change the Fore Color of each label to 6184448.
5. In the MouseMove event of the DETAIL section use this
code:

Dim i As Integer
On Error Resume Next
For i = 1 To 8
Me("OptionLabel" & i).ForeColor = 6184448
If Err <> 0 Then
Err.Clear
Exit For
End If
Next i

6. In EACH MouseMove event of the individual labels use
code like this:

Me.OptionLabel1.ForeColor = 16777215

Change the control name of course for each label.

The BEST result I've seen is ONLY the first label changing
color as I move the mouse around! Sometimes nothing
changes! I've even tried various coding options, but still
only the first label changes color. I've even tried to
move the mouse around really slowly, but no difference. I
also tried changing the fore color of each label in Design
View to either color and same result.

I even tried this code instead in the Detail MouseMove
event:

Me.OptionLabel1.ForeColor = 6184448
Me.OptionLabel2.ForeColor = 6184448
Me.OptionLabel3.ForeColor = 6184448
Me.OptionLabel4.ForeColor = 6184448
Me.OptionLabel5.ForeColor = 6184448
Me.OptionLabel6.ForeColor = 6184448
Me.OptionLabel7.ForeColor = 6184448
Me.OptionLabel8.ForeColor = 6184448

No change at all.

Does the same thing happen for you?
Am I coding this wrong? (more likely)

Thanks for any help,
Jeff Conrad
Bend, Oregon

Jeff -

See this note in the help entry for MouseMove:

<quote>
This event doesn't apply to a label attached to another control, such as
the label for a text box. It applies only to "freestanding" labels.
Moving the mouse pointer over an attached label has the same effect as
moving the pointer over the associated control. The normal events for
the control occur; no separate events occur for the attached label.
</quote>

As created by the Switchboard Manager, the labels are attached to the
command buttons. I find that if I select all the labels, cut them from
the form, then paste them back (repositioning them as a group is easy)
and reset their OnMouseMove event properties to "[Event Procedure]", it
works properly. Or, even better, use the MouseMove events of the
buttons themselves instead of the labels -- then you can leave the
labels attached and the labels will highlight when you mouse over either
the labels or the buttons.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
J

Jeff Conrad

Hallo Bas!

Good to see you back!
Actually the problem was with attached labels.
See Yoda's response.

Thanks again for the help (past and present),
Jeff Conrad
Bend, Oregon
 
D

Dirk Goldgar

Jeff Conrad said:
Hi Yoda!

Well I'll be darned!!
Disconnecting the labels was just the trick.
Where the heck did you find that information, I've been battling this
for two days?!

I followed your directions and reproduced the problem -- none of the
labels was being changed -- so I put a breakpoint on the MouseMove event
procedure and moused over it. The breakpoint wasn't triggered! So I
checked to make sure the OnMouseMove property was wired up properly --
it was. The only conclusion to be drawn was that the event wasn't
firing, so the last remaining question was whether it was a bug or by
design. I looked at the help for the MouseMove event, and there it was.

Breakpoints are wonderful things.
 
J

Jeff Conrad

Hi Yoda,

Ok, well now I'm just going to crawl back under the bridge now.
Webster's Dictionary--Definition: Stupid......see Jeff

Jeff Conrad
Bend, Oregon
 

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