Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    37

    Angry Unanswered: Calling a procedure from a subform...

    Need help calling a function from a subform.

    I keep receiving an error that the program cannot find my subform.

    Here's the code (the error is in the attachment):

    <On click of cmb button located on subform>
    Call mso_asr_check_blanks

    <In Module>
    Public Function mso_asr_check_blanks()

    Dim x
    Set x = Forms![frm_ent_pft_asr]![frm_ent_pft_asr_subval].Form.[pft_asr_ee_revper]

    If IsNull([x]) = True Or [x] = "" Then
    [x].SetFocus
    MsgBox "Please specifiy a review period."
    End

    End If

    End Function
    Attached Thumbnails Attached Thumbnails error.jpg  

  2. #2
    Join Date
    May 2002
    Posts
    37
    OK..Fixed the module
    <In Module>
    Public Function mso_asr_check_blanks()

    Dim x
    Set x = Forms![frm_ent_pft_asr]![child43].[pft_asr_ee_revper]

    If IsNull([x]) = True Or [x] = "" Then
    [x].SetFocus
    MsgBox "Please specifiy a review period."
    End

    End If

    But now I am given an error that x does not support the setfocus function.

  3. #3
    Join Date
    Mar 2002
    Posts
    192
    sounds like what you need to pass the form in as a variable.

    ie

    public function MyFunction (l_MyForm as form)

    end function

Posting Permissions

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