TO:WWWWA
我的代码是:
Private Sub TreeView9_NodeClick(ByVal Node As Object)
Dim db As Database
Set db = CurrentDb
For Each frm In db.Containers("Forms").Documents
MsgBox frm.Name
Next
SQL = "SELECT TreeID, ParentID, TreeCaption, TreeImage, OnAction FROM Tree where TreeID=" & Mid(Node.key, 2) & " ORDER BY TreeID;"
Call Connection_String
Conn.Open ConnectionString
Rs.CursorLocation = adUseClient
Rs.Open SQL, Conn, adOpenDynamic, adLockOptimistic
With Me
.TxtTreeID = Rs(1)
.TxtParentID = Mid(Node.key, 2)
.TxtTreeCaption = Rs(2)
.TxtTreeImage = Rs(3)
.TxtOnAction = Rs(4)
End With
Rs.Close
Conn.Close
End Sub
TxtOnAction是一个组合框,我需要在这个组合框中显示当前数据库所有的窗体名称,谢谢
DIM db As Database
Set db = DBEngine.OpenDatabase("123.MDB", False, False, "MS Access;pwd=''")
For Each frm In db.Containers("Forms").Documents
MSGBOX frm.Name
Next