• Visible Property

    Author
    Topic
    #462825

    Good Morning,

    The process I have is as follows:

      [*]Goal
      [*]Outcome

    This is a 1-2 many relationship based on member.
    Each goal MUST have an assigned outcome before closing the case. However, while the case is still open, there can/will be many goals w/o outcomes as well as many goals w/outcomes. If the goal doesn’t have an assigned outcome yet, the user can change the goal, otherwise, the user should get a message informing them the goal has an assigned outcome and can’t be changed.

    My forms controls consist of the following:

      [*]Goal
      [*]Outcome
      [*]Option Group (Replace and Remove)

    My problem is for all the goals that don’t have an assigned outcome I need the option buttons within the option group where outcome is null visible = True and for all the goals that have an assigned outcome the option button within the option group visible=false.

    So, let’s say I have 5 goals, 3 with assigned outcomes and 2 w/o assigned outcomes. I need the option buttons visible=false for 3 records and option buttons visible=true for 2 records.

    I thought I could apply a loop statement to loop through the recordset, that didn’t work. I’ve tried a FOR EACH statement to loop through the controls and that didn’t work.

    Can someone please point me in the right direcetion?

    Viewing 2 reply threads
    Author
    Replies
    • #1179195

      What type of form are you using? A single form or a continuous form?

      • #1179202

        What type of form are you using? A single form or a continuous form?

        Continuous

        • #1179205

          Continuous

          Therein lies the problem – if you change the property of a control on a continuous form, it changes for all records. Other than going to a different form of navigation, such as a treeview or grid control, I think you will have to go to the single data record display so you can turn the visible property on and off. One trick that has been used is to use conditional formatting on a text box and treat it like a command button, but that can get pretty convoluted.

    • #1179207

      Thanks Wendell, much appreciated.

      Changing to single isn’t an option. What if I removed the option group and put a field with in the dataset, say “int_OutcomeAssigned”, make it a bound control on the form. Put code in the OnLoad event along these lines.

      [codebox]If int_OutcomeAssigned=0 then
      int_OutcomeAssigned.visible=False
      Else
      int_OutcomeAssigned.visible=True
      end if
      [/codebox]

      • #1179215

        A continuous form actually contains only a single set of controls. If you hide a control, it’ll be hidden in all records. The only formatting that can depend on the data is conditional formatting, but hiding a control is not among the available options in conditional formatting, and moreover it only applies to text boxes and combo boxes, not to option buttons and option groups.

        I’m afraid there is no way to do what you want. Sorry!

    • #1179230

      What I need, is it acheivable if I change the form to “Single” and apply a list box and apply code to the AfterUpdate Event of the list box? Along the lines of:

      [codebox]if IsNull(lstOutcome.column(4)) then
      msgbox “1”
      else
      msgbox “2”
      end if[/codebox]

      • #1179231

        Yes, it’s possible to hide/show controls based on the value of other controls in a single form. You have to run code in two places:
        – In the After Update event of the control whose value determines whether the other controls are visible.
        – In the On Current event of the form, so that the visibility is updated correctly as the user moves from record to record.

    Viewing 2 reply threads
    Reply To: Visible Property

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: