Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Acess VBA: How do I replace reserved characters in a string?

Posted on 2011-10-19
Medium Priority
Last Modified: 2012-06-27
I am using the OutputTo method in Access. I want to strip the reserved characters for naming Windows files in a string and replace them with a string that does not cause an error.

Example: report name to export is "10/19/11 Inventory, Current". I want to rename as "10-19-11_Inventory_Current".

Question by:CafeTica
  • 2
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36994743
open the db, and select the Report, then hit F2 and change the name

or right click on the Report and then select Rename

Author Comment

ID: 36994779
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 36994819
dim stDocName

strDocName="10/19/11 Inventory, Current"

strDocName=replace(replace(replace(strDocName,"/","-"),", ","_")," ","_")

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question