Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Checking return for Select in macro

I want to provide a message if the Select in the macro fails. With the code below, I'm getting the error Expected 'Then', with "District of Columbia" = false then highlighted. Anyone have a suggestion? Thanks.

if ActiveDocument.Fields("STATE_NAME"). Select "District of Columbia" = false then msgbox("Data does not exist for the selected Reporting State.")

end if





Tags (1)
1 Solution

Accepted Solutions

Checking return for Select in macro

To get a return value from Select, you must use the function argument form -- that is, enclose the argument in parens.

if ActiveDocument.Fields("STATE_NAME").Select("District of Columbia") = false then msgbox("Data does not exist for the selected Reporting State.")


Also. if using the single-line syntax If, don't include an End If.

-Rob

3 Replies

Checking return for Select in macro

To get a return value from Select, you must use the function argument form -- that is, enclose the argument in parens.

if ActiveDocument.Fields("STATE_NAME").Select("District of Columbia") = false then msgbox("Data does not exist for the selected Reporting State.")


Also. if using the single-line syntax If, don't include an End If.

-Rob

Not applicable

Checking return for Select in macro

Sorry, that shouldn't have posted.





Not applicable

Checking return for Select in macro

Rob, that is exactly what I needed. Thanks for your help. Laurie

Community Browser