0

I have been hitting Google for a while, this one is getting plain frustrating now as I can't seem to fix it. I keep getting Invalid Qualifier when trying to use the String.Replace() function.

I am trying to create a file name for storing a PDF document but there are a few exceptions where the Ref# in the table have /'s in them. My code is as follows

Dim tempRef As String
...    
tempRef = recordSet("Ref#")
MyFileName = MyPath & tempRef.Replace("/", "") & ".pdf"

Unsure why but I keep getting the "invalid qualifier" error for executing this function.

Apologies for simplicity of this one...

2
  • @Eray thanks mate, that worked. Was using [msdn.microsoft.com/en-us/library/… site) as reference, can't understand why that wouldn't be noted... Cheers mate Commented Nov 5, 2015 at 23:03
  • You are very welcome, buddy. I will be glad if you select my answer as the correct answer below. Commented Nov 5, 2015 at 23:04

1 Answer 1

2

Please try:

MyFileName = MyPath & Replace(tempRef, "/", "") & ".pdf"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.