2 Replies Latest reply: Mar 8, 2012 7:22 AM by Abdur Razak Amod RSS

    Selection based on Input

      Hi,

       

      I have a macro:

       

      sub selectYear

                msg = inputbox("Please Enter Year: ")

                ActiveDocument.Fields("ThemeDate").Select "*/*/msg*"

      end sub

       

      when the user types "2011" all entries for the year 2011 should show, but it does not.

       

      But when I have :

       

      sub selectYear

                msg = inputbox("Please Enter Year: ")

                ActiveDocument.Fields("ThemeDate").Select "*/*/2011*"

      end sub

       

      the macro works,

       

      I know it has to do with the input, do I have to trim(take away trailing whitespace) it or something like that.

       

       

      Kind Regards

      Razak