Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I created a variable vMaxWeek containing the last week loaded, i want to create a vb script (macro) which is putting a slection of the field week based on the content of the vMaxWeek.
like: activedocument.Fields("Week").Select "$(vMaxWeek)
But this is not working, has anyone an idea how to work with the content of a variable in VB?
I also tried to use the getvariable but without succes.
Thanks for any help!
Kind regards,
Linda Monincx
Hi Linda,
You can do it like this:
sub test
set v = ActiveDocument.Variables("vTest")
ActiveDocument.Fields("F1").Select v.GetContent.String
end sub
This assumes that you have a variable called vTest and you want to select the matching value from a field called F1.
However, in QlikView 9 there's no need to use a macro for this. Instead this can be achieved with a simple action trigger.
1. Create a button
2. Assign the "Select in Field" action. Point the Field to F1 and the Search string to =$(vTest), and you should get the same result.
Hi Linda,
You can do it like this:
sub test
set v = ActiveDocument.Variables("vTest")
ActiveDocument.Fields("F1").Select v.GetContent.String
end sub
This assumes that you have a variable called vTest and you want to select the matching value from a field called F1.
However, in QlikView 9 there's no need to use a macro for this. Instead this can be achieved with a simple action trigger.
1. Create a button
2. Assign the "Select in Field" action. Point the Field to F1 and the Search string to =$(vTest), and you should get the same result.
Great that works thanks for the help!
Linda