我用DataGrid显示了三条记录的标题,是从Acess中搜出来的,我现在想要的就是鼠标点击其中一条,就可以在一个新窗口中显示这条记录的详细内容,数据库中标题和内容的字段分别是title和content,请问我该怎么做。
    如果可以的话,请说的详细点,小弟是个新手,只会用
       Private Sub DataGrid1_Click()
          Form2.Show
       End Sub
    来显示新窗口,十分着急,需要帮助,谢谢了

解决方案 »

  1.   

    datagrid_mousemove
    调动tooltiptext
      

  2.   

    这样有什么问题?
    Private Sub DataGrid1_Click()
        If DataGrid1.Row <= 0 Then
            MsgBox "请选中一条记录"
            Exit Sub
        End If
        
        Form2.vID = DataGrid1.Text 'Form2中定义一个公有类型变量,Form2_load中按这个值来查询
        Form2.Show
    End Sub
      

  3.   

    form2:
    Private title As String
    Private content As String
    Public Function Gettitle(ByVal mStr As String)
        title = mStr
    End Function
    Public Function Getcontent(ByVal mStr As String)
        content= mStr
    End Functionform1:
    Private Sub DataGrid1_Click()
        If DataGrid1.Row <= 0 Then
            MsgBox "请选中一条记录"
            Exit Sub
        End If
        
        Form2.Gettitle DataGrid1.Text
        Form2.Getcontent DataGrid1.Text    Form2.Show End Sub
      

  4.   

    在窗体中增加一个带参数的ShowEx公有过程
      

  5.   

    1.用DataGrid1.Text 得到记录内码
    2.用ado得到数据title和content,填到Form2.text1控件中,再form2.show