Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hiya Guys,
Is it possible to use the function GetFieldSelections within a module?
I have tried this as a test, but it does not work (the Module window opens when triggered, but showing no error):
'*** Update Chart Forecasts depending on current Selection ***'
Sub UpdateForecasts()
Set varSelectionMonth = GetFieldSelections(DateCourse_MonthNumber,",",12)
MsgBox varSelectionMonth
End Sub
Does anyone have any ideas?!
Cheers,
Steve.
Hi,
At the module, the method .evaluate is very useful.
You can use any expression that you would use at the interface as an argument.
In your case, you can try:
Set varSelectionMonth =ActiveDocument.Evaluate( "GetFieldSelections(DateCourse_MonthNumber,",",12)" )
MsgBox varSelectionMonth
or
Msgbox (ActiveDocument.Evaluate("GetFieldSelections(DateCourse_MonthNumber,",",12)" )
Hope it helps,
Erich
try to make a textbox (paste a getselected funciont to it) and then go to module take the value from textbox
Hi,
At the module, the method .evaluate is very useful.
You can use any expression that you would use at the interface as an argument.
In your case, you can try:
Set varSelectionMonth =ActiveDocument.Evaluate( "GetFieldSelections(DateCourse_MonthNumber,",",12)" )
MsgBox varSelectionMonth
or
Msgbox (ActiveDocument.Evaluate("GetFieldSelections(DateCourse_MonthNumber,",",12)" )
Hope it helps,
Erich
this one works fine
Msgbox (ActiveDocument.Evaluate("GetFieldSelections(X)" ))
Thanks Guys!
The ".Evaluate" function is exactly what I was after!
Strangely enough, it was the "Set" keyword which was causing the Module window to open when calling the subroutine. Without it, this code worked fine:
varSelectionMonth = ActiveDocument.Evaluate("GetFieldSelections(DateCourse_MonthNumber,',',12)")
MsgBox (varSelectionMonth)
I'm not entirely sure when/why to use "Set" - QlikView has so many different (illogical!) ways to do things it's appalling!!!
Cheers,
Steve.