The expression On Click you entered as the event property setting produced .... (2 Viewers)

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
Hi all

I have the Access DB which has now been running for 6 months. It consists of a data file with various tables which is saved on a server and local-based access-vba code which links to the data tables and performs the necessary data operations. The system has between 3-4 users at the same time every day.

It normally works fine, but every now and then we are getting an error like this:

"The expression On Click you entered as the event property setting produced the following error:."

This happens randomly, sometimes 2-weeks in between, and sometimes 3 times a day. It is also happening at different parts of the code, but always at a stage when the system is adding, editing or updating a record in one of the tables. Error happens when handling different tables so it is not related to just one table.

I modified the code to avoid having a long time between the .edit/.addnew and the .update lines but the problem is still there.

I suspect it could be related to a loss of connectivity on the network, but I am not sure of this and cannot find a way of proving it.

Any ideas please?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:52
Joined
May 7, 2009
Messages
19,169
is your db split?
 

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
Yes. As I explained I have a data file (with various tables) on a server and the users have an application on their PC which contains no data but links to the data file. The VBA code is all in this local application. I do not use macros but only VBA code.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:52
Joined
May 7, 2009
Messages
19,169
try recompiling your vba. make sure all modules have Option explicit on them.
 

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
Done. Now I'll see if the problem re-occurs or not. I forgot to mention that the applications on the user's pc are all accde's.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:52
Joined
May 7, 2009
Messages
19,169
after putting Option Explicit and re-compile your code did you see the error?
 

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
No.It just reduced the file size and compiled without any issues.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:52
Joined
Feb 28, 2001
Messages
26,996
The OnClick event originates from the front end so if this error occurs again even after the recompile, the next step is to assume some kind of corruption. To have the front end complain about that link to the OnClick event code further indicates corruption. When this happens, does it always happen for the same user? Is there any pattern that you can see of who gets - and who doesn't get - the error?

Arnel's suggestion to recompile is a proper first step. If the error comes back, then if you have a protected (separate) developer's copy of the DB, you might wish to just make a new version for distribution as a way to forestall further errors (if this is due to some type of corruption).

Just as a quickie question: Is it possible that your users are actually trying to run the shared copy of the FE file rather than a distributed copy that only runs on their individual workstations? If so, that would be a source of corruption caused by file locking errors.
 

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
So after 2 weeks from the decompile and recompile the error showed up once. But this is no news, I have had instances in the past were up to 3 weeks passed in between errors and then the same error would maybe show up once, or maybe 3 times in 1 day and then disappear again. So it is completely irregular.

Also there are 2 key users of this system and they both got their share of errors. Now a 3rd one has been added (yesterday). So far no errors.

So What they run is a .bat file in their desktop. This batch file checks if the version of the application in the C drive matches that of a target folder in the server (where I always place the latest .accde version). If the versions don't match then the Batch file deletes the local accde and copies the new accde to the local. If the versions match then the batch file loads the local accde.

So there is not chance that the users are NOT using the local accde.

Moreover I have one main accdb which I use as a development file. I backup a copy of this every time I start a new modification. When I make a change and test it I create an accde of it and move it to the target folder on the server so that it can then update all users when they next load the system.

Now I have added a textbox for debugging purpose. And in the code, before and after the various .edit and .update operations I have added a line to display in this textbox that the code has passed through that step. So whenever the error occurs, the users send me a screenshot and I know where the code stopped.

And it stops at different parts of the code, but always when performing an edit function. Also, the table being edited is not always the same one.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:52
Joined
Feb 19, 2002
Messages
42,970
Rather than checking versions, try always replacing the FE with a clean copy.

Are you using WIFI or a wired connection. Access is very susceptible to network drops and they happen with some frequency on a WIFI connection. If you cannot use a wired connection, the best solution is to convert the BE to SQL Server. You will still experience problems but will probably not end up with corrupted data.
 

rkaptu

Registered User.
Local time
Today, 01:52
Joined
Oct 27, 2017
Messages
19
Dear Pat. Thanks for that.

I have created a completely new accdb and copied the modules from the old one to the new one, decompiled and recompiled, and compacted&repaired it. Now I want to see whether the error reoccurs or not... it might take some days.

I like the idea of replacing the FE more often and not just on version change. I can do an automatic re-download every day. I will see how to do that in the batch file.

Finally the connection issue was one of my theories. It is all on a wired network, but the PCs and FE are on a particular network, and the BE is on a different network with both networks linked to allow access. Our IT guys are wondering whether this could be an issue. I have tried to add a function to check whether there is a connection before each .edit and .update function. But it did not give any feedback or benefits.

Now we agreed that if the error continues we will move one of the FEs on the same network of the BE and see if the error is limited to the other PCs (thus proving that the issue is with the communications between the networks).

Re moving BE to SQL I will consider that.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:52
Joined
Feb 28, 2001
Messages
26,996
but the PCs and FE are on a particular network, and the BE is on a different network with both networks linked to allow access.

The only time this will give you trouble is if the linkage is either selective to protocols or if it is somehow flaky. Otherwise, it should be no problem. I had this many times with my Navy network because we had an in-house network and an out-house network. (Well, out-of-house, but we never called it that...) It always worked just fine.

The IT guys would know whether their firewalls are selective with respect to the protocols they allow. If they aren't filtering or restricting in some way, then there should be no need to move anything to another network. As long as Windows File Sharing works across the two nets, Access will work. (Same protocols for both, SMB = Server Message Block.)

The only other thing that could be happening is if something is trying to alter the event property, which is theoretically possible but fraught with peril.
 

JHB

Have been here a while
Local time
Today, 09:52
Joined
Jun 17, 2012
Messages
7,732
Maybe it's not so much a connection question but more a time issue, how deep in the disk root are the databases located?
But you will confirm or disprove it by having both the BE and FE databases on the same server.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:52
Joined
Feb 28, 2001
Messages
26,996
Granted, having a database (or any other widely shared file) nearer to the root of the mapped disk is preferable for security reasons, but Access doesn't time out on a file operation; a busted network might time out, but Access won't. If there IS a problem that is solved by moving the files to be on the same machine, that speaks poorly of the IT staff who set up the network because in that case, it is not doing what a network is supposed to be doing.

In a properly configured network, unless there is a specific type of filtering going on, you aren't supposed to be able to tell that the files WEREN'T local. That's the whole point of TCP/IP and the SMB file sharing protocols.
 

Users who are viewing this thread

Top Bottom