Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing a quotation mark to a select string from macro

I am trying to create a button to automatically select a couple items from a field.  If I were to just type in the select string it would be :"AF  "|"N   "|"MC  "|"A   ".  However I can't pass the quotes in the macro.  I have tried multiple things, such as """ to get around it, but nothing is working.  Any suggestions?

Thanks in advance,

Therese

Labels (1)
1 Solution

Accepted Solutions
tanelry
Partner - Creator II
Partner - Creator II

Use chr(34) in macro

v = "(" & chr(34) & "AF " & chr(34) & "|" & chr(34) & "N " & chr(34) & ")"

ActiveDocument.Fields("FieldName").Select v

If you use QV10 then better assign "select in field" action for button instead of macro,

with static select string as ("AF "|"N ")

or calculated as ='(' & '"AF "' & '|' & '"N "' & ')'

View solution in original post

2 Replies
tanelry
Partner - Creator II
Partner - Creator II

Use chr(34) in macro

v = "(" & chr(34) & "AF " & chr(34) & "|" & chr(34) & "N " & chr(34) & ")"

ActiveDocument.Fields("FieldName").Select v

If you use QV10 then better assign "select in field" action for button instead of macro,

with static select string as ("AF "|"N ")

or calculated as ='(' & '"AF "' & '|' & '"N "' & ')'

Not applicable
Author

Thanks...  I had actually gotten to there a couple days ago, but had my quotes in there wrong.  I didn't realize until I had it set a variable as the string I created. 

Thanks!