I am running Access 2007 on a Windows Vista PC.
I have VBA code that works fine once the "Save" button is selected in the code editor window and continues to work as expected until I exit Access. When I re-launch Access, the code no longer performs the expected actions until I select "View Code" and "Save" once again. I do not have to make any changes to the code. The expected actions once again are performed until I exit Access. Any ideas as to why this is happening?
The Access VBA module creates a Word 2007 MailMerge letter from a .dotx template. That code works fine every time so is not a problem. Additional code at the end of the module activates the Word application and document and brings the Word window to the front with focus. This is the part of the code that works when "Saved" until I exit Access. When I re-launch Access and perform this action (i.e., select the button to which the code is attached), the Word window after being created stays hidden behind the Access window. If I then "Save" the code (without change), it starts working properly.
I have VBA code that works fine once the "Save" button is selected in the code editor window and continues to work as expected until I exit Access. When I re-launch Access, the code no longer performs the expected actions until I select "View Code" and "Save" once again. I do not have to make any changes to the code. The expected actions once again are performed until I exit Access. Any ideas as to why this is happening?
The Access VBA module creates a Word 2007 MailMerge letter from a .dotx template. That code works fine every time so is not a problem. Additional code at the end of the module activates the Word application and document and brings the Word window to the front with focus. This is the part of the code that works when "Saved" until I exit Access. When I re-launch Access and perform this action (i.e., select the button to which the code is attached), the Word window after being created stays hidden behind the Access window. If I then "Save" the code (without change), it starts working properly.
Comment