Image mouse click event doesn't work

mixail

Registered User.
Local time
Tomorrow, 00:44
Joined
Apr 25, 2010
Messages
18
Hi there,

I would like to add code to close the form to the on click event of an unbound OLE object which i have paste from Fireworks.
I put the code in, but when I click the object it doesn't run, however, if I right click first then left click the code runs and closes the form.
Why is this and what do I need to do to make it run when clicked?
It's strange because the closed next image with the same settings and events works fine.
I also change image on mouse move and on mouse down event.

BR,
mixail.
 
What version of Access are you using and on what OS? Is everything up to current patch level?
 
What version of Access are you using and on what OS? Is everything up to current patch level?

WIN 7 Ultimate
Access 2007 (12.0.6423.1000) SP2 MSO (12.0.6535.5002)
Everything is up to date

The strange think is that before that happens other image mouse events were OK.
The only different think which I've done is that i don't insert pictures from access toolbar i just directly paste them from Fireworks.
I have tried to change object (image) name, but without success.

I wont to do this:
I have tree images. They have to be changed on exact mouse events.
On Mouse Move works fine. On Mouse Down and Mouse Click access wont to accept like event and don't run the code behind the event.

BR,
mixail.
 
Last edited:
I wouldn't be pasting them directly. You should be saving the image and then adding it through the interface to add a control.
 
I wouldn't be pasting them directly. You should be saving the image and then adding it through the interface to add a control.

I've tried that also, but the result is the same.
Don't accept mouse click as event.
Just if first you click with the right mouse button and the left.
 
The only suggestion I have right now is if you can upload a copy of your database with that form and the tables/queries behind that form (if there are any) and make sure there is no sensitive data in there and then run Compact and Repair and then zip it. After that, upload it here so we can take a look and see if we can figure it out.
 
The only suggestion I have right now is if you can upload a copy of your database with that form and the tables/queries behind that form (if there are any) and make sure there is no sensitive data in there and then run Compact and Repair and then zip it. After that, upload it here so we can take a look and see if we can figure it out.

Here is the example.
As you will see the "green +" doesn't work and the "blue disk" works fine as i want.
Try with right and then left mouse click.

BR,
mixail.
 

Attachments

Just an FYI with Access VBA: If your intent with
Public but_add, but_edit, but_delete, but_save, but_cancel, but_close, but_print, but_help As Byte
was to have them all defined as Byte, you will have to change the code. As written, all but but_help are variant type. All as Byte would be:
Public but_add As Byte, but_edit As Byte, but_delete As Byte, but_save As Byte, but_cancel As Byte, but_close As Byte, but_print As Byte, but_help As Byte
As a side note, with most modern machines the Byte type is really inefficient and certainly does not save any memory since pretty much everything needs to be on at least a 32 bit boundry. In this case I would probably just use an Integer.
Edit: None of that will affect you problem of course.:D
 
Last edited:
Just an FYI with Access VBA: If your intent with
Public but_add, but_edit, but_delete, but_save, but_cancel, but_close, but_print, but_help As Byte
was to have them all defined as Byte, you will have to change the code. As written, all but but_help are variant type. All as Byte would be:
Public but_add As Byte, but_edit As Byte, but_delete As Byte, but_save As Byte, but_cancel As Byte, but_close As Byte, but_print As Byte, but_help As Byte
As a side note, with most modern machines the Byte type is really inefficient and certainly does not save any memory since pretty much everything needs to be on at least a 32 bit boundry. In this case I would probably just use an Integer.
Edit: None of that will affect you problem of course.:D

Thanks wish me a luck ;)
 
I can’t view an accdb file but someone may check this.

With both Mouse Down and Mouse Click events the Mouse Down event happens before the Mouse Click event.
If the Mouse Down event transfers focus to another image then the Mouse Click event may not fire for the first image.
 
Hi,

Here is Access 2000/2003 version.

BR,
mixail.
 

Attachments

I can’t view an accdb file but someone may check this.

With both Mouse Down and Mouse Click events the Mouse Down event happens before the Mouse Click event.
If the Mouse Down event transfers focus to another image then the Mouse Click event may not fire for the first image.

Look at the ms access 2000/2003 example above and you will see the mystery.
 

Users who are viewing this thread

Back
Top Bottom