Catch 22

aziz rasul

Active member
Local time
Today, 18:42
Joined
Jun 26, 2000
Messages
1,935
I have a series of buttons on a form. Let's call them Command1, Command2 & Command3.

Under each of the command buttons, under the "On Mouse Move" event, I have: -

DoCmd.GoToControl "Command1"
DoCmd.GoToControl "Command2"
DoCmd.GoToControl "Command3"

When the mouse moves over a particular command button, it gives the impression that the command buttons have the focus.

I have an event procedure behind Command1 which runs a series of queries. If a user moves the mouse over the command buttons, when the event procedure is running, it comes up with a run-time error 2486. The error message is "You can't carry out this action at the present time".

I temporarily solved the problem by making the Enabled property of command buttons, "Command2" & "Command3" equal to False and reset them to True at the end of the procedure.

However I still have the problem that a user may still move the mouse over "Command1" while the procedure is running. Any ideas how I can resolve this.

I have posted this topic in the Forms section as well.


[This message has been edited by aziz rasul (edited 12-14-2000).]
 
Hi Aziz
Why are you using GoToControl method?
Kaspi
 
Kaspi,

The reason for using the GoToControl method on each command button is that when the mouse cursor moves over the buttons, the buutons appear as if they have been selected. If you try it, you will see what I mean.

Pat,

The reason that I placed the question in both places was that it was a Form problem as well as a potential VBA problem.
 

Users who are viewing this thread

Back
Top Bottom