Image Click event

zeidhaddad

New Member
Joined
Oct 4, 2019
Messages
14
Hello People, I'm trying to figure out a code which perform this : clicking on a image to open a certain form.
I tried using this DoCmd.OpenForm "NameOfForm", , , "Image1=" & Image
where Image 1 is the name of the image that i want to click on to open the form. any ideas ?
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hello,

Just right click and select Assign a macro ...

Hope this will help
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,650
Office Version
365
Platform
Windows
Just right click and select Assign a macro ...
That sounds like an Excel solution, not an Access one (this is posted in the Access forum).
Just to make sure, I tried it in Access, and don't see that option.

I think what you need to do is to select the image, right-click, select Properties, go to the Event tab, and kick off the Code Builder on the "On Click" event.
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Sorry for the confusion ... :oops:

Thought it was an Excel related question ...
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
53,650
Office Version
365
Platform
Windows
Thought it was an Excel related question ...
I am guessing that you were working from the "Zero Rreply Posts" list and didn't notice the forum listed in the right-most column.;)
It happens from time-to-time!
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
I am guessing that you were working from the "Zero Rreply Posts" list and didn't notice the forum listed in the right-most column.;)
It happens from time-to-time!

Spot on ... !!! :)
 

Micron

Well-known Member
Joined
Jun 3, 2015
Messages
1,849
It looks to me as if you're trying to pass an image name as the parameter for the Where condition. That will never work because it expects a sql statement that is a valid Where clause (without the word Where). I don't see where the image name that you're clicking on has anything to do with the form you want to open? Why not just DoCmd.OpenForm "NameOfForm" ?
 

Watch MrExcel Video

Forum statistics

Threads
1,102,305
Messages
5,486,072
Members
407,531
Latest member
WalterR01

This Week's Hot Topics

Top