Bit of a weird one (1 Viewer)

ryetee

Registered User.
Local time
Today, 11:45
Joined
Jul 30, 2013
Messages
952
I'm getting an intermittent error which I'm not sure how to track down.
It started last night. I was working on a form that I was happy with. I'd been 'testing' it as I went along and all was OK. I can't quite remember the sequence of events but I either closed access and reopened it or I restarted my project from within access and I got my first screen up screen A. I was then going to double click on an item on that screen which should bring up screen B. From there with a further double click it takes me to screen C the one I had been working on.
With the double click on screen A i get an error message saying file doesn't exists and I'm thrown into the VBA for screen C! Nothing was highlighted but I was thrown into design mode for screen C. screen B and screen C are instances(?) of a collection. Closing the screen C it stops the code. I then started to wonder what was going on trying to get to screen B in different ways. It suddenly started working again without me really doing anything. I tried it a few times and all was well. I out it down to access getting tangled up so ignored it until just now. I've just fired up the application and got the same error. Again I was trying to figure out what the problem is and it's gone again and I can't replicate.

So.....
What could it have been? How do you track these sort of errors down and get rid of them.

Oh and recently I've been getting access is not responding. It then wants me to save a backup and restart. What could be causing this and is it related to the above?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:45
Joined
May 21, 2018
Messages
8,463
I have never seen anything like that. I would create a new database. Import the tables into it. Do a compact and repair. Then import all the other objects. Then compact and repair on more time and compile the code.
 

ryetee

Registered User.
Local time
Today, 11:45
Joined
Jul 30, 2013
Messages
952
I have never seen anything like that. I would create a new database. Import the tables into it. Do a compact and repair. Then import all the other objects. Then compact and repair on more time and compile the code.

Not done this but since I posted it hasn't happened again!!
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:45
Joined
May 21, 2018
Messages
8,463
You may still want to be safe and create the clean db.
 

Cronk

Registered User.
Local time
Today, 22:45
Joined
Jul 4, 2013
Messages
2,770
I doubt if "an intermittent error" is occurring but more likely an unusual confluence of data input, order of data input, user action or other situation which has not been provided for in code.

Use line numbers in your code, trap for the error and record the line number and error details in a table. That will help you drill down on what is happening. It may take some iterations to drill down and maybe need the recording of variable values when the error occurs.

When you can replicate the intermittent error, you can then fix it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:45
Joined
Feb 28, 2001
Messages
27,001
From the sound of it, particularly the "not responding" but also the behavior in question, this is a corrupted database. Cronk's advice is good but if it is corruption then that won't help. Try MajP's advice first, see if that helps. If no, Cronk's advice is good. as a next step.
 

isladogs

MVP / VIP
Local time
Today, 11:45
Joined
Jan 14, 2017
Messages
18,186
From the description, if corruption is involved its in your code rather than your data.

If so, before doing either of the other suggestions, I would make a BACKUP then DECOMPILE your application to remove any compile code which may be corrupted, then COMPILE again & finally COMPACT.

Info about decompiling here: http://www.fmsinc.com/microsoftaccess/performance/decompile.asp

Only if that fails would I recommend copying items into a new database.
If that also fails, then go through step by step as Cronk suggests
 

ryetee

Registered User.
Local time
Today, 11:45
Joined
Jul 30, 2013
Messages
952
I doubt if "an intermittent error" is occurring but more likely an unusual confluence of data input, order of data input, user action or other situation which has not been provided for in code.

Use line numbers in your code, trap for the error and record the line number and error details in a table. That will help you drill down on what is happening. It may take some iterations to drill down and maybe need the recording of variable values when the error occurs.

When you can replicate the intermittent error, you can then fix it.

Not sure what you're on about.
The error I get is along the lines of file doesn't exist. I get no error number, and nothing is highlighted in the VBA code as to the line it's falling over on.
I'm sure your right about the sequence of events but yesterday I basically opened up access and went through a few clicks and it fell over. I replicated that after closing and restarting and all is well. Incidentally hasn't happened since.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 07:45
Joined
May 21, 2018
Messages
8,463
You are correct. No way is this a data thing. That is not going to pop open a form in design view or throw you into the VBE. However, I would read Ridder's post. If you were to create a new db and import in all the objects you still would import in the potentially corrupted code. Need to consider the decompile which is not difficult to do.
 

isladogs

MVP / VIP
Local time
Today, 11:45
Joined
Jan 14, 2017
Messages
18,186
You are correct. No way is this a data thing. That is not going to pop open a form in design view or throw you into the VBE. However, I would read Ridder's post. If you were to create a new db and import in all the objects you still would import in the potentially corrupted code. Need to consider the decompile which is not difficult to do.

That was indeed my point.
I'm always amazed when copying items into a new database is suggested as the first solution.
Its not unusual for the shiny new database to then exhibit the same symptoms as the original.
Decompiling takes a matter of seconds to do and in my experience almost always does the job perfectly.
I use it often enough to have a desktop shortcut: Access Decompile

What of course it can't do is to fix corrupted data.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:45
Joined
May 7, 2009
Messages
19,175
are you the obe are trying to save the form class in a cillection? if so lets start from there. even if you compact, decompile or make new db out of it it wont work. you need to show the code.
 

ryetee

Registered User.
Local time
Today, 11:45
Joined
Jul 30, 2013
Messages
952
are you the obe are trying to save the form class in a cillection? if so lets start from there. even if you compact, decompile or make new db out of it it wont work. you need to show the code.
obe?
anyway it's all working now...
 

Users who are viewing this thread

Top Bottom