Solved Extract Forms/Reports/Scripts/Modules/Queries from external database

Your original error was caused because you defined an object using one name and referenced it with another. That would have shown up as an error if you bothered to define Option Explicit and compile your code before running it which is the best practice I was trying to encourage you to switch to but that seems to have gone totally over your head.

So, your original error just magically fixed itself? It is more likely that arne rather than using his words to explain your problem so you learn something from the effort we all put into trying to help you, just went ahead and fixed your compile errors for you so you never were aware of what caused the base problem.

I don't get paid to do this so I am not inclined to just fix your problems, especially when they are trivial (and common) as this mistake is. You need to understand what caused the problem or you will continue to make it over and over again. As far as I'm concerned, you learned nothing from this thread.
 
Last edited:
some modules was removed because I don't have any issue with.
Perhaps, but it still does let it compile?
Unless it does, how do you know what on earth you have? :( just in syntax alone?
 
Your original error was caused because you defined an object using one name and referenced it with another.
with due respect to the OP, that is not the "original" error.
even if you resolved the missing object, or just delete every code in the form and just
leave the code on the "Export Docs" button, you will still get the "original error" which is
(by debugging):
noObj.png


that is Exporting an Object (on this case the Forms), that are Not in the Currentdb (see post #14).
 
@arnelgp I wasn't saying there wasn't a second error, only that you couldn't get to the second error without fixing the compile error - and there are STILL compile errors, just not with the code in question.

The code worked for me once I fixed the compile error. Well, not worked but it did execute. It just exported the objects in the current db rather than in the selected db.

I was going to mention that the code needed two db references, one for the current db and the second for the sourcedb. But I could never get a response regarding the compile error and I just forgot about it. And then you posted a "fixed" version but never bothered to mention what you fixed, including the compile error. I have a database that documents other databases and to do that, I have to have references to both databases depending on whether I am accessing tables in the "remote" db or logging the extracted data to my documentation db.
 
only that you couldn't get to the second error without fixing the compile error
if you will have time to test the db, before justifying, you will see that it never complains about any undefined sub/function.
when you press the "Export docs" button it goes directly to "ExportDocs" subs.
and will error on the first form name.
 
@arnelgp I have tested it. Once I fixed the compile errors, the code ran without error. Although, as I said, it exported the objects from the current database because THAT is the database i put into the file name box because I could see that the code wouldn't actually work as written. That was not the desired objective which leads to the second error which is creating an object to reference a different database than the one running the code.

I've wasted enough time on this post. I'm moving on.
 

Users who are viewing this thread

Back
Top Bottom