Subform OnCurrent not changing .Visible

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RobH
    New Member
    • Jul 2007
    • 56

    Subform OnCurrent not changing .Visible

    I have a Form - With a combo Box "Type" This selects a category eg TK, RR, PM etc

    In the subform it shows the records with field [PT] = Type
    On the subform I want to limit what Fields are visible dependant on the Type Selected.

    To this end i have set the OnCurrent to

    Code:
    If Parent![Type] = "TK" then
     ME.PL.Visible = False
    Else if Parent![Type] = RR then
     ME.PL.Visible = True
    .
    .
    Endif
    However when the type is changed the visible does not change - even though the Category listed does change to match the type selected.

    Thoughts??
    Last edited by RobH; Sep 15 '07, 04:33 AM. Reason: Solved by self
  • Scott Price
    Recognized Expert Top Contributor
    • Jul 2007
    • 1384

    #2
    Originally posted by RobH
    I have a Form - With a combo Box "Type" This selects a category eg TK, RR, PM etc

    In the subform it shows the records with field [PT] = Type
    On the subform I want to limit what Fields are visible dependant on the Type Selected.

    To this end i have set the OnCurrent to

    Code:
    If Parent![Type] = "TK" then
     ME.PL.Visible = False
    Else if Parent![Type] = RR then
     ME.PL.Visible = True
    .
    .
    Endif
    However when the type is changed the visible does not change - even though the Category listed does change to match the type selected.

    Thoughts??
    Hi Rob,

    I see you made an edit/comment that you had solved this yourself. Likely the solution involved putting this into the AfterUpdate event of your [Type] field?

    Regards,
    Scott

    Comment

    • JConsulting
      Recognized Expert Contributor
      • Apr 2007
      • 603

      #3
      Originally posted by RobH
      I have a Form - With a combo Box "Type" This selects a category eg TK, RR, PM etc

      In the subform it shows the records with field [PT] = Type
      On the subform I want to limit what Fields are visible dependant on the Type Selected.

      To this end i have set the OnCurrent to

      Code:
      If Parent![Type] = "TK" then
       ME.PL.Visible = False
      Else if Parent![Type] = RR then
       ME.PL.Visible = True
      .
      .
      Endif
      However when the type is changed the visible does not change - even though the Category listed does change to match the type selected.

      Thoughts??
      When you try to set properties that change the visible aspect of your forms, you usually have to refresh your form/subform in order to see the changes. Values act differently as they update with the event. Just a thought.
      J

      Comment

      Working...