This is the code:
Sub mnuShowTable_Click
'will show the first 20 rows of the selected table
'-------------------------------------------------
Dim lNodeIndex
Dim strTable
Dim strSQL
lNodeIndex = Tree.IndexOfNode(Tree.SelectedNode)
If lNodeIndex = -1 Then
Msgbox("You need to select the node with the table name.", _
"showing table sample", _
cMsgboxOK, _
cMsgboxNone)
Return
End If
strTable = Tree.SelectedText
strSQL = "SELECT * FROM " & strTable & " limit 20"
cmd.CommandText = strSQL
cmd.ExecuteTable("Table1", 20)
Form2.Close
End Sub
RBS