benkingery
Registered User.
- Local time
- Today, 16:24
- Joined
- Jul 15, 2008
- Messages
- 153
I am having a difficult time with some VBA code running a replace function. Specifically, I'm trying to update a field that contains gender information. The information is contained in my database as follows: "Womens". HOWEVER, I need to run a VBA function to replace all instances of "Womens" with "Women's".
The problem arises with how you must use quotation marks (") and apostrophes(') in VBA to run queries. Any ideas how I can get this to work?
here is what I currently have:
This obviously doesn't work because of the mismatch of apostrophes and quotation marks.
Thanks in advance.
The problem arises with how you must use quotation marks (") and apostrophes(') in VBA to run queries. Any ideas how I can get this to work?
here is what I currently have:
Code:
DoCmd.RunSQL "UPDATE Table1 SET Table1 .Field10 = Replace([Table1 ].[Field10 ],'Womens','Women's')"
This obviously doesn't work because of the mismatch of apostrophes and quotation marks.
Thanks in advance.