Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Call command (A2000 SR1)

    On a main form I have a control button which performs a certain action when pressed.
    On the main for is a subform.
    I want to call the control button from the sub.
    Heres what Ive tried so far.

    Select case keycode
    case vbkeyf7
    call Forms!frmDetails!command305_click
    End select

    Select case keycode
    case vbkeyf7
    call Forms.parent.command305_click
    End select


    Select case keycode
    case vbkeyf7
    call ([frmDetails])!command305_click
    End select

    I've tried all sorts and cannot call the code of the button.

    help's required if poss.

    Regards
    Dave

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Call command (A2000 SR1)

    By default, event procedures in a form are Private; that means they can't be accessed from outside the form module.

    Make the Command305_Click procedure Public instead of Private. Call it from the subform as

    Parent.Command305_Click
    or
    Form_frmDetail.Command305_Click
    or
    Forms!frmDetail.Command305_Click

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Call command (A2000 SR1)

    Thanks Hans
    This did the trick:

    Parent.Command305_Click

    Regards
    Dave

Posting Permissions

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