Access 2007: On-click not working

V

veli.izzet

Hi,

The following piece of code that used to work an an Access 2003 form is
not working in Access 2007.

---------

Private Sub cmdUrunKart_Click()
On Error GoTo Err_cmdUrunKart_Click

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptUrunKart"
stLinkCriteria = "[UrunID]=" & "'" & Me![UrunID] & "'"
If Me.Dirty = True Then Me.Dirty = False

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_cmdUrunKart_Click:
Exit Sub

Err_cmdUrunKart_Click:
MsgBox Err.Description
Resume Exit_cmdUrunKart_Click

End Sub
 
D

Dirk Goldgar

Hi,

The following piece of code that used to work an an Access 2003 form
is not working in Access 2007.

---------

Private Sub cmdUrunKart_Click()
On Error GoTo Err_cmdUrunKart_Click

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptUrunKart"
stLinkCriteria = "[UrunID]=" & "'" & Me![UrunID] & "'"
If Me.Dirty = True Then Me.Dirty = False

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_cmdUrunKart_Click:
Exit Sub

Err_cmdUrunKart_Click:
MsgBox Err.Description
Resume Exit_cmdUrunKart_Click

End Sub
-----

Thanks for any help about this code.

Regards,

In what way is it not working? Is it giving you an error message, or is
absolutely nothing happening, or what? If there's an error message,
what is it? If you set a breakpoint in the code and click the command
button, is the breakpoint triggered? Can you step through the code from
the breakpoint? If so, what line causes the error?
 
V

veli.izzet

Hi,

I get the following error message:

The expression On Click you entered as the event property setting
produced the following error: Aproblem occured while finethings was
communicating with the OLE server or activex control" etc. etc.

It used to have no problem with Access 2003, now I have this problem
with Access 2007. I also use On Current on the same form to show
pictures of items from a folder, and I have the same problem there too.

Regards


Dirk said:
Hi,

The following piece of code that used to work an an Access 2003 form
is not working in Access 2007.

---------

Private Sub cmdUrunKart_Click()
On Error GoTo Err_cmdUrunKart_Click

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rptUrunKart"
stLinkCriteria = "[UrunID]=" & "'" & Me![UrunID] & "'"
If Me.Dirty = True Then Me.Dirty = False

DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_cmdUrunKart_Click:
Exit Sub

Err_cmdUrunKart_Click:
MsgBox Err.Description
Resume Exit_cmdUrunKart_Click

End Sub
-----

Thanks for any help about this code.

Regards,

In what way is it not working? Is it giving you an error message, or is
absolutely nothing happening, or what? If there's an error message,
what is it? If you set a breakpoint in the code and click the command
button, is the breakpoint triggered? Can you step through the code from
the breakpoint? If so, what line causes the error?

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

(please reply to the newsgroup)
 
D

Dirk Goldgar

Hi,

I get the following error message:

The expression On Click you entered as the event property setting
produced the following error: Aproblem occured while finethings was
communicating with the OLE server or activex control" etc. etc.

It used to have no problem with Access 2003, now I have this problem
with Access 2007. I also use On Current on the same form to show
pictures of items from a folder, and I have the same problem there
too.

I would first check the references, as described by Doug Steele here:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

If that doesn't correct the problem, try decompiling the application, as
described by Tony Toews here:

http://www.granite.ab.ca/access/decompile.htm

Be sure to make a backup copy before doing this. Also be sure, when
decompiling, to use the correct version of Access.

If you are actually using a OLE server (for example, you have an
embedded Word document), make sure that the server application is
installed. Also, try turning off script blocking in your antivirus
program and see if that makes a difference.
 
K

kimberlytenay

I would first check the references, as described by Doug Steele here:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

If that doesn't correct the problem, try decompiling the application, as
described by Tony Toews here:

http://www.granite.ab.ca/access/decompile.htm

Be sure to make a backup copy before doing this. Also be sure, when
decompiling, to use the correct version ofAccess.

If you are actually using a OLE server (for example, you have an
embedded Word document), make sure that the server application is
installed. Also, try turning off script blocking in your antivirus
program and see if that makes a difference.

Hi,

I am also having the same problem, only that when I click absolutely
nothing happens. Everything else is working just on click in all my
forms are not working.


Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Data Input Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub


Thanks
 
D

Dirk Goldgar

Hi,

I am also having the same problem, only that when I click absolutely
nothing happens. Everything else is working just on click in all my
forms are not working.


Private Sub Command13_Click()
On Error GoTo Err_Command13_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Data Input Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_Command13_Click:
Exit Sub

Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

End Sub

And you get no error message? Just ... nothing happens?

The first thing to check is that the OnClick property of the control --
as listed on the Events tab of the control's property sheet in design
view -- is set to "[Event Procedure]". The second thing to check is
that the control's name hasn't been changed so that it no longer matches
the name of the event procedure.

You say this is happening with all your forms? That's odd. Did you do
a massive rename of some sort? If not, and if the event properties and
procedure names are all correct, then try following the instructions at
the link I posted in my previous reply, to check for and correct broken
references.
 
K

kimberlytenay

I am also having the same problem, only that when Iclickabsolutely
nothing happens. Everything else isworkingjust onclickin all my
forms arenotworking.
Private Sub Command13_Click()
On Error GoTo Err_Command13_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Data Input Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command13_Click:
Exit Sub
Err_Command13_Click:
MsgBox Err.Description
Resume Exit_Command13_Click

And you get no error message? Just ... nothing happens?

The first thing to check is that the OnClick property of the control --
as listed on the Events tab of the control's property sheet in design
view -- is set to "[Event Procedure]". The second thing to check is
that the control's name hasn't been changed so that it no longer matches
the name of the event procedure.

You say this is happening with all your forms? That's odd. Did you do
a massive rename of some sort? Ifnot, and if the event properties and
procedure names are all correct, then try following the instructions at
the link I posted in my previous reply, to check for and correct broken
references.

--
Dirk Goldgar, MSAccessMVPwww.datagnostics.com

(please reply to the newsgroup)- Hide quoted text -

- Show quoted text -

Thanks for the help, I got it to work the code was disabled for
security reasons. I added the folder the application was coming from
as a trusted location and now it works.

Thanks
 

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

Similar Threads


Top