the expression OnClick...error

sjl

Registered User.
Local time
Today, 16:33
Joined
Aug 8, 2007
Messages
221
Hi,

Users of my recently-updated 2003 Access (split) database are getting this error message:

The expression OnClick you entered as the event property setting produced the following error: The expression you entered has a function name that MS Office Access can’t find.


In my revisions, I did not add or change any OnClick events -- my updates were to algorithms in one query, formatting changes in forms and reports, and 2 old reports were moved from one sub-menu of the switchboard to another.

I've looked through all my forms for OnClick expressions and only found OnClick events in the Switchboard (for it's 8 different bottons: =HandleButtonClick(x).

As stated previously, I did move 2 old reports to a different submenu within Switchboard, but did not manipulate the OnClick events).

Users are getting the OnClick error but I am not; the only difference between my cpu and theirs is that I also have version 2010 loaded (but am not using it for this work).

I looked at several threads in this forum trying to debug this annoying problem. At the suggestion in one Thread, I did turn the “Break on Unhandled Errors” utility; then opened every query, form, and report to see if I got an error. No “breaks” occurred.

Any ideas of what else I might do (other than uninstall 2010....)?

thanks in advance,
sjl
 
Here's something worth trying. On the user's machine go into the vba editor and choose Debug > Compile. Hopefully the compiler will highlight the line of code causing the error.

Did you add any UDFs? If so, the problem is likely a lack of sandbox mode on the user machines. You can turn on sandbox mode by running this code:

Code:
  Private Sub setSandBoxMode()
    Dim strFile As String, Quote As String, strMainValue As String, currentKey As String, line As String
    Quote = """"
    'We'll be looking for a value of 3
    strMainValue = Quote & "SandBoxMode" & Quote & "=dword:00000003"
    strFile = "C:\Sandbox.Reg"
    'Export the current registry value to the above file:
    Shell "REGEDIT.EXE  /E " & strFile & Space(1) & Quote & "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines" & Quote
    'Read the file to see if sandbox mode is already set correctly:
    Open strFile For Input As #1
    Dim found As Boolean
    Do While Not EOF(1)
        Line Input #1, line
        If InStr(line, strMainValue) > 0 Then found = True
    Loop
    Close #1
    If Not found Then 'registry value is not yet set
        Open strFile For Output As #1
        Print #1, "Windows Registry Editor Version 5.00"
        Print #1, ""  'blank line
        Print #1, "[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines]"
        Print #1, strMainValue
        Close #1
        'The S-Switch means silent mode so the user doesn't have to click OK.
        Shell "Regedit.Exe /S " & strFile
    End If
    Kill (strFile)
End Sub


Or, you can manually change the registry setting, as follows. If you are new to the registry, be especially careful. From the Start > Run line type RegEdit and then navigate to this registry setting:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\SandboxMode
In the right pane you might see
0x00000002
which is value 2. Right-click 'SandboxMode' and select "Modify", this will open a window displaying the current value, typically you'll see the one digit "2" so just overtype it with the one digit "3" which means "Use Sandbox mode always."
 
Jal,
Thanks much. I actually didn't create any UDF's (wish I could say that I had :^). However, I will definitely try the vba editor|debug|compile thingy. I had actually done that with the dbase on MY machine before deploying the dbase, but yes, it makes more sense to do it on their machines (however, there are 14 of them....).

I actually came to some sort of resolution to this yesterday by re-doing my enhancements and changes on a machine that did NOT have Access v2010 installed. When I finished, wah-lah....the testers had no problems with the database. I'm thinking there are shared files out there (shared between 2003 and 2010...) and somehow this creates this annoying OnClick error....

thanks again Jal,
Sarah
 

Users who are viewing this thread

Back
Top Bottom