5 Replies Latest reply: Apr 19, 2016 10:20 AM by jagan mohan rao appala RSS

    Clearing always one on list box on leaving sheet

    Rhona Corcoran

      Hi I am trying to remove the always one selected on a list box when I leave a sheet and re-activate when I go back to the sheet.

       

      I have the following sub and have the first one in the trigger for on opening sheet and the second one for when you leave the sheet.

       

      It is getting rid of the always one selected when I leave the sheet but it is not re-applying when I go back to it.

       

      Any help would be great

       

      Thanks

       

       

      Sub Alwaysoneselected

       

       

      Set QvObj = ActiveDocument.GetSheetObject ("LB202")

      Set MyField = QVObj.GetField

      Set FieldProp = MyField.GetProperties

      FieldProp.OneandOnlyOne = True

      MyField.SetProperties FieldProp

       

       

      End Sub

       

       

      Sub RemoveAlwaysoneselected

       

       

      Set QvObj = ActiveDocument.GetSheetObject ("LB202")

      Set MyField = QVObj.GetField

      Set FieldProp = MyField.GetProperties

      FieldProp.OneandOnlyOne = False

      MyField.SetProperties FieldProp

      ActiveDocument.ClearAll True

       

       

      End Sub