locked
Export issues with MS Access 2010 forms not retaining the VBA embedded code on specific machines RRS feed

  • Question

  • Background:

    I have an offline network that I administer electronic tests on multiple machines using an Access developed product via drive mappings. I created an event that pushes the test files (2 tables, 2 forms, 1 query, 1 macro) to a database file on the target machines,  I have 8 machines total.  The source form is the same object that is exported to every machine.

    For instance, on Machine1 the forms arrived stripped of all VBA code and Machine2 the form arrives with VBA intact. The exact same command is used for both, except the drive reference, see below. What is more interesting is that I can manually select the form object, export it to Machine1 and the VBA will be intact on Machine1. I can even run it as a stored procedure and it works as well. What is worse this was the second attempt to load these files onto Machine1, the first attempt, early Nov 2012 it worked fine as originally coded. The only difference is that the Office product entered “the invalid” period and I had to manually update the key and activation code. Machine2 has had this happen but the forms still function normally, so I doubt this is the issue.

    It has to be something on the clients, but I am not sure what that might be. I perfer to have standard procedures for delivering the tests and do not want to create and store the necessary procedures for each instance of every test I have to deliver. I want the VBA code to correctly export the forms to all machines with VBA intact.

    The export code is as follows for Machine1:
    DoCmd.TransferDatabase acExport, "Microsoft Access", "R:\Secured\Target.accdb", acForm, "frm_CoreTask_Test", "frm_CoreTask_Test", 0

    The export code is as follows for Machine2:
    DoCmd.TransferDatabase acExport, "Microsoft Access", "S:\Secured\Target.accdb", acForm, "frm_CoreTask_Test", "frm_CoreTask_Test", 0

    The export code that did work for Machine1 is as follows:
    DoCmd.RunSavedImportExport "Export-Target_R"
    However, this requires creating more objects in the database to save the export procedures, which I would prefer not to do.

    Truobleshooting thus far:
    Compared MS Access Options Settings from Machine1 to Machine 2 - Identical for all tabs, including Trust Center
    Security Setting on files and destination folder in Windows7 OS - Identical
    Code in VBA module for Machine1 and Machine2 - identical except drive desginations

    Whatever help you can provide would be greatly appreciated.


    Friday, November 30, 2012 7:28 PM

All replies

  • Hi FM_SF_Instructor,

    Welcome to the MSDN forum.

    Would you please try with the full path of the database?

    DoCmd.TransferDatabase acExport, "Microsoft Access", "\\MyComputer1\Secured\Target.accdb", acForm, "frm_CoreTask_Test", "frm_CoreTask_Test", 0

    You may check the following thread:

    SendObject: how get HTML Template used? Access 2010
    http://social.msdn.microsoft.com/Forums/en-GB/accessdev/thread/fe45a192-deb8-485a-813d-accb96ecf232

    Have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 3, 2012 9:48 AM
  • Thanks for the advise.

    However, the error was due to a miscellaneous problem in the code running on the machine acting as the main data processing workstation. I closed the database and reopened the database and it worked again. Can't really explain it much more than that. I believe that your syntax would have resulted in the same issue since it was the instance of Access that was causing the problem.

    Tuesday, December 4, 2012 9:21 AM