On Click Event Problem

G

Gaetan

Hi,

I have created an OnClick event on a picture in a main menu that opens
another form with the following code:

Private Sub Image2_Click()

Me.Visible = False
DoCmd.OpenForm "frmAssociates"

End Sub

When I click on the image, it gives me the following message:

The expression On Click you entered as the event property setting produced
the following error: A problem occurred while Microsoft Office Access was
communicating with the OLE server or ActiveX Control.

I don't know what I should do to make it work.

Someone knows what I've been doing wrong?

Thanks.
 
M

Maurice

Try to insert a picture instead of an OLE object than paste your original
code behind the click event of that picture.

So in designview choose: Insert picture -> choose your picture. Access will
place your picture and then from the properties of that picture (in
designview) choose click_event and paste your original code.

hth
 
G

Gaetan

It's still giving me the same message....

Maurice said:
Try to insert a picture instead of an OLE object than paste your original
code behind the click event of that picture.

So in designview choose: Insert picture -> choose your picture. Access will
place your picture and then from the properties of that picture (in
designview) choose click_event and paste your original code.

hth
 

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