Avatar of avoorheis
avoorheis
 asked on

Access macro / vba code transfertext not over writing files.

I have set up several macros and some vba routines that use the transfer text or transfer spreadsheet commands to create files on various network folders. These routines, I thought, would just overwrite the existing files. In fact, I've tested each one several times to make sure (like changing the data, run the routine and then making sure the data had been updated).

I happened to review one of the files and found that the data had not been updated, even though the timestamp of the file showed that it had been modified that day. When I found this, I deleted the file and re-ran the code, which created the file with the correct data. I even ran my test again where I modified the data in the file and re-ran the code to make sure the data was updated and it was.

The only thing I can figure is that if someone else opens the file and saves it, something happens to the permission and access won't actually overwrite the data, even though the modified date was changed and Access did not report any problem.

Since I've found this, I've implemented changes that will just delete the existing file before updating (so, just creating a new file each time).

My actual question is can someone confirm what I believe is happening or have a different explanation?

thanks
alan
Microsoft AccessWindows Networking

Avatar of undefined
Last Comment
avoorheis

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jeffrey Coachman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
avoorheis

ASKER
Thanks for confirming my assumption. I believe it has to do with the way our network folders are implemented and how Access interacts with those rules. I'll implement your strategy where I can, otherwise, I'll just delete the old file first.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy