Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I wanted to create a button that specifies a search on a field.
The field is "AGE" and the search should be "> vAGE_TRES".
"vAGE_TRES" is a variable and defined as 20.
The problem is that it does not work! When I specifiy "= vAGE_TRES" it accepts the variable and its value, but when I use greater than ">" it does not work.
Any idea?
I'm assuming you are using a V9 action of "Select in Field". Try the following as the Search String in the Action:
='>$(vAGE_TRES)'
-Rob
Your search probably should be
"> $(vAGE_TRES)"
That will change your variable back to a number
= is probably working as a string compare
Also "> $(vAGE_TRES)" does not work.
Hi,
I think you can use a macro to solve the problem something like this in VBS:
sub searching
SET f = ActiveDocument.GetField ("YOURFIELD")
f.Select "YourVariable "
end sub
Maybe it will work
I'm assuming you are using a V9 action of "Select in Field". Try the following as the Search String in the Action:
='>$(vAGE_TRES)'
-Rob
hi, you an use the following as a macro in your application
sub period
str = ActiveDocument.Variables("vAGE_TRES").GetContent.String
mySelect= ">" & str
ActiveDocument.Fields("Age").Select mySelect
end sub
thanks
Thanks Rob, your solution
='>$(vAGE_TRES)'
worked!
I didn't try the macro yet.
I tried it as well, and it works like a charm......tried for hours and always ended in a dead end street.
Can you maybe explain what the $ does in the equation?
Thanks - Coert
The $ just evaluates the variable.