>> Using the code from Tom's link,
You don’t need that code nor link that Tom posted.
The information Tom provided was due to you having showed your compile error. That compile error suggested you are missing the code provided in that link.
However, the j-street re-linker ALREADY provides that code. So you posted a compile error – that thus suggested that the fix was to go to that “link” to grab some code that you are missing.
So Tom’s link was to provide some code was either removed by you, or missing when you imported the j-street link code. Everyone believed you had imported the j-street code correctly – but THEN you stated AFTER doing this you had compile errors. This information
is now shown to be wrong.
So when working with computers – if we assume you followed the instructions and you get that compile error, THEN YES you would have to go to that link Tom provide and grab that code.
However, Tom had simply assumed you were following the advice here correctly.
So now that we cleared up the above, you don’t need nor want to bother with that code Tom pointed to. In other words the compile error you posted DOES suggest you were missing that code. Since we resolved now that you had not imported the j-street code correctly
in the first place, then you don’t need nor want to bother with that code link.
If AFTER importing the j-street code that compile error existed, then yes you would and should import the “file dialog” code Tom pointed to.
However once you cleared up that if you start over, import the j-street code and ZERO compile errors occurred, then the additional advice to fix your compile errors is NOT required by bothering with the link and code that Tom pointed to.
So to be clear:
If after importing the j-street code (as we all assumed you did correctly), if you were STILL having compile errors, then you would need to import that additional code Tom pointed to.
However, now that we resolved that no compile errors exist after correctly importing the j-street code you thus don’t need to bother with that link and code Tom provided.
And to be “really” clearer, the j-street code in fact “borrowed” and uses the code in Tom’s link.
So you don’t need nor want to bother with the link provided Tom, since after “correctly” importing the j-street code you don’t have any compile errors and thus there is nothing to fix.
The real lesson here is if you provide incorrect advice then the advice you receive here will also be incorrect. Computers don’t “guess”, but only follow instructions you give them. If you don’t follow instructions, then the advice you get will be wrong
– this is what occurred in Tom’s case.
>> my question would be: Using the code from Tom's link
As pointed out you don’t need that code or link – it is already part of the j-street code sample.
>>what should I put in an autoexec macro and/or can I put a button on the screen to run the re-link manually.
You don’t need to modify what is already in the AutoExec sample from j-street. ALL you have to do is import the AutoExec macro and should be good to go.
>> can I put a button on the screen to run the re-link manually.
You certainly could provide a button – but the AutoExec macro is called “auto” for a good reason – it will run on start-up automatic. So you really don’t need a button to run the re-link code if you simply import that AutoExec macro from the j-street sample.
You can most certainly open the autoexec macro in design mode and take a quick look to see what is inside of that macro. (It simple runs the re-link function – and you can use the SAME code as that macro behind a button on a form if you wish).
So behind a VBA button on a form you could use this line of code:
jstCheckTableLinks_Full()
However the above is exactly what is inside the AutoExec macro. So that “function” will “run” on application start-up since that is what “AutoExec” is for (to run some code on application start-up).
So you really don’t need a form with a button to re-link if you choose to import and use the already pre-made and provided auto Exec macro for your convenience.
Good luck!
Regards,
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada