Solved Tips To Ascertain 'User-Defined Type Not Defined' Error (1 Viewer)

dalski

Member
Local time
Today, 00:53
Joined
Jan 5, 2025
Messages
232
I have Option Explicit & Option Compare in ALL code behind forms, modules & classes. But I receive no highlighted prompt where the error occurs. I thought I'd solved it a week ago but I keep receiving it on compiling. Pretty sure it's not reference related as I've not changed anything there. I've exhasuted MSN's guide but am still encountering intermittently. Strange that it does not occur consistently which logically you'd think it'd be runtime related but correct me if I'm wrong this error is NOT runtime related?

I tried exporting modules/ classes temporarily deleting items to localise the issue; which I thought was between two forms but I cannot get consistency in spotting the error & I'm not positive the error is in these forms.

Does anyone have any tips for me on how to identify having suffered a similar issue in the past? I imagine despite how tempting it is to proceed & generate more code to develop the application but will then be even harder to identify the error?
 
2. Try DEcompiling your project

Thanks so much Colin, immediate fix; so grateful. I wonder what caused that. Is this type of thing usually caused by bad practice or can I rest assured that it's usually some sort of corruption which has now been rectified in decompiling?
 
Last edited:
We have to remember that Microsoft employees are also presumably human and therefore capable of human error. We ASSUME they are all humans, anyway. It takes a well-meaning human to really screw things up. Sort of like politicians anywhere.
 
Thanks so much Colin, immediate fix; so grateful. I wonder what caused that. Is this type of thing usually caused by bad practice or can I rest assured that it's usually some sort of corruption which has now been rectified in decompiling?

If it keeps happening then it’s probably bad practice! 🙂
If this has fixed it for the foreseeable future then you’ve cleared the corruption issue however it occurred. In which case, blame Access (fairly or not)!
I find certain apps get repeated minor corruption during development usually due to me failing to save and compile before testing. Many other apps never need decompiling
 
Thanks Colin, be interesting to see what happens. If it is bad practice (which is a very good chance) I pray I'm able to find the problem :eek:.
 
Last edited:
Do you routinely do the following?

  1. Edit vba code while the project is in Break mode
  2. Fail to Compile prior to running code/using database after having edited code
 

Users who are viewing this thread

Back
Top Bottom