+ Reply to Thread
Results 1 to 2 of 2

Send a frame control to a procedure as a parameter

  1. #1
    JDMils
    Guest

    Send a frame control to a procedure as a parameter

    I have code which will enable one of 10 frames on a form depending on a
    control parameter which is predetermined. Here is my code which enables a
    fram control and all controls within it:

    Private Sub ActivateFrameAndControls(ByRef aFrame As Object)
    aFrame.Enabled = True
    ' Cycle thru all controls in the respective frame.
    For Each InnerCtrl In aFrame.Controls
    ' Enable each one.
    InnerCtrl.Enabled = True
    Next InnerCtrl
    End Sub

    My problem is that my calling code will pass th frame to the procedure, but
    the line "aFrame.Enabled = True" fails with the error "Runtime error 438.
    Object does not support this property or method".

    Here's my calling code:

    If bShowApp Then ActivateFrameAndControls (Me.fraApp)



  2. #2
    JDMils
    Guest

    Re: Send a frame control to a procedure as a parameter

    Found the problem....it was in my calling code. It should have been:

    If bShowApp Then Call ActivateFrameAndControls (Me.fraApp)

    --

    |
    +-- JDMils
    |

    "JDMils" <[email protected]> wrote in message
    news:[email protected]...
    >I have code which will enable one of 10 frames on a form depending on a
    >control parameter which is predetermined. Here is my code which enables a
    >fram control and all controls within it:
    >
    > Private Sub ActivateFrameAndControls(ByRef aFrame As Object)
    > aFrame.Enabled = True
    > ' Cycle thru all controls in the respective frame.
    > For Each InnerCtrl In aFrame.Controls
    > ' Enable each one.
    > InnerCtrl.Enabled = True
    > Next InnerCtrl
    > End Sub
    >
    > My problem is that my calling code will pass th frame to the procedure,
    > but the line "aFrame.Enabled = True" fails with the error "Runtime error
    > 438. Object does not support this property or method".
    >
    > Here's my calling code:
    >
    > If bShowApp Then ActivateFrameAndControls (Me.fraApp)
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1