Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good Morning,

    The process I have is as follows:
    1. Goal
    2. 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:
    1. Goal
    2. Outcome
    3. 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?
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    What type of form are you using? A single form or a continuous form?

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='795460' date='29-Sep-2009 12:39']What type of form are you using? A single form or a continuous form?[/quote]
    Continuous
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    [quote name='RNCIENG' post='795467' date='29-Sep-2009 06:52']Continuous[/quote]
    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.
    Wendell

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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]
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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!

  7. #7
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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]
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •