I have to take back my last comment, reproducing the error I also do get error #2005.
One more idea: If you modify the Load event of forms to store SYS(16) somewhere into a txt file or DBF as "last started form" reference, an error handling of error 2005 cn inspect that form file (scx or vcx), go to the recno mentioned in the error number and store the property memo of that record to see what's stored in there right at the time it happens.
In form.load events (ideally in your baseform) put
Code:
StrToFile(Sys(16),"laststartedform.txt")
Either you keep it that simple, but have SAFETY set off, or you get tons of questions about overwriting. Better yet, change that to writing it into a DBF or append to a log file, or you store it into a PUBLIC variable. Whatever, also adapt the following error handling to find the last started form causing the error 2005:
In error handling handle 2005 errors this way:
Code:
AError(laError)
If laError[1]=2005
lcRecno = StrExtract(laError[2],'record number ','.',1,1)
lcLastForm = FileToStr("laststartedform.txt") && adapt according to where you store Sys(16) in form.load
lcFormFile = StrExtract(lcLastForm,":\","SCT",1,4)
lcForm = ForceExt(JustStem(lcFormFile),"scx")
Use (lcForm) In 0 Again Alias problematicform
Select problematicform
Go Val(lcRecno)
* adapt to store in an error.dbf, instead. Just for example:
StrToFile("Properties of Record "+lcRecno+" in Form "+lcForm+":"+Chr(13)+Chr(10)+problematicform.Properties,"problematicpropertieserror2005[s][/s].txt")
EndIf
Then you can see what properties are actually loaded at runtime from the EXE. If there is no FontCharSet line in the properties (or whatever else is said to be illegal) then the default is illegal, which is unfortunate. In case of the FontCharSet the font name could also play a role. If that's also not set I think VFP stores a default font an size etc into the last record of an SCX and uses that, typically Arial. I think the label would then use that font or the OS tells the standard font the user configured in Windows settings. A missing font or a font not supported by VFP or GDI+ might cause this, too, in the end.
I strongly recommend you adopt this and don't use it 1:1 as in the form it is, you'll need write permission to the default folder, which could be the program files folder and then that's not working, also you would only ever save the last properties of the last 2005 error. I don't know what else you have in a base form class or whether you even use one, you also will need to embed this into your error handling as special case handling anyway. But that's enabling to see what properties are in play at the time of the error.
What this will not show in case there is no FontCharSet line in the properties, is what default value was causing that error. But perhaps the fontname will help to figure out whether there is a font missing or another problem with it.
Good luck with it.
Chriss