我想通过一个变量传递From.Name,然后再用这个变量引用这个窗体,应该怎样做啊?

解决方案 »

  1.   

    Private Sub Form_Load()
    GetForm("form1").Caption = "Hello"End SubFunction GetForm(ByVal sName As String) As Form
        For Each GetForm In Forms
            If UCase$(GetForm.Name) = UCase$(sName) Then Exit Function
        Next
        Set GetForm = Nothing
    End Function
      

  2.   

    Private Sub Form_Load()
    dim frm as Form
    set frm=GetForm("form1")
    frm.Show
    End SubFunction GetForm(ByVal sName As String) As Form
        For Each GetForm In Forms
            If UCase$(GetForm.Name) = UCase$(sName) Then Exit Function
        Next
        Set GetForm = Nothing
    End Function
      

  3.   

    对啊    传递  CAPTION  属性值就好了....    NAME  传递不了的......