Thanks for reporting this. I’ve confirmed a bug in Studio’s method editor that could explain what you’re seeing.
Studio stores the complete module as one source file, although the editor displays each method separately. A diagnostic can therefore refer to line 2032 of the module even when no individual method has that many lines.
The bug occurs when a method contains another Function or Sub declaration. The editor can mistake the nested declaration’s closing line for the end of the outer method, leaving some source hidden from the method editor. Removing the nested declaration can then leave an extra End Function behind, which the compiler correctly rejects.
I reproduced that sequence and obtained the same error message. However, I would need to inspect your project to confirm that this is exactly what happened in your case.
I’ve logged the editor bug here. The fix will keep nested declarations and their closing lines inside the editable method body, with regression tests covering this behaviour.
Could you send me the project so I can check ModBaseDatos and identify the precise correction?