Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Sorry, that shouldn't have posted.
Rob, that is exactly what I needed. Thanks for your help. Laurie