home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fTables
- BackColor = &H00C0C0C0&
- Caption = "<none>"
- ClientHeight = 3255
- ClientLeft = 510
- ClientTop = 1575
- ClientWidth = 3000
- Height = 3660
- Icon = TABLES.FRX:0000
- Left = 450
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MDIChild = -1 'True
- ScaleHeight = 3235.273
- ScaleMode = 0 'User
- ScaleWidth = 3020.896
- Top = 1230
- Width = 3120
- Begin CommandButton NewTableButton
- Caption = "&New"
- Height = 375
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 855
- End
- Begin CommandButton StructButton
- Caption = "&Design"
- Height = 375
- Left = 2040
- TabIndex = 2
- Top = 120
- Width = 855
- End
- Begin CommandButton OpenButton
- Caption = "&Open"
- Height = 375
- Left = 1080
- TabIndex = 1
- Top = 120
- Width = 855
- End
- Begin ListBox cTableList
- BackColor = &H00FFFFFF&
- Height = 2175
- Left = 120
- Sorted = -1 'True
- TabIndex = 0
- Tag = "OL"
- Top = 855
- Width = 2775
- End
- Begin Label TableListLabel
- BackColor = &H00C0C0C0&
- Caption = "Tables:"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 584
- Width = 2775
- End
- ' rbd - Add feature to immediately display SQL if list item clicked
- ' is a query and "display SQL" is enabled. Also, clear the
- ' SQL window if table is not a query.
- Option Explicit
- Sub cTableList_Click ()
- On Error Resume Next
- Dim qd As QueryDef
- Dim iTableType As Integer
- iTableType = TableType((cTableList))
- 'check to see if the selected table is
- 'actually a querydef in an Access database
- 'and display the SQL if pref is set.
- '(rbd) If not a querydef, then CLEAR the SQL
- If gstDataType = "MS Access" Then
- If iTableType = DB_QUERYDEF Then
- Set qd = gCurrentDB.OpenQueryDef(cTableList)
- If VDMDI.PrefDisplaySQL.Checked = True Then
- fSql.cSQLStatement = qd.SQL
- End If
- qd.Close
- Else
- fSql.cSQLStatement = ""
- End If
- End If
- End Sub
- Sub cTableList_DblClick ()
- gfFromSQL = False
- Call OpenButton_Click
- End Sub
- Sub Form_Load ()
- If gfDBOpenFlag = True Then
- Caption = gstDBName + "." + gstDataBase
- End If
- 'set the height and width
- Height = 3870
- Width = 3156
- Top = 0
- Left = 0
- End Sub
- Sub Form_Paint ()
- Outlines Me
- End Sub
- Sub Form_Resize ()
- On Error Resume Next
- If WindowState <> 1 Then
- cTableList.Height = Height - 1350
- cTableList.Width = Width - 320
- Outlines Me
- Me.Refresh
- End If
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Me.WindowState = 1
- Cancel = True
- End Sub
- Sub NewTableButton_Click ()
- If gfDBOpenFlag = False Then
- MsgBox "No DataBase Open", 48
- Exit Sub
- End If
- gfAddTableFlag = True
- fTblStru.Show MODAL
- End Sub
- Sub OpenButton_Click ()
- On Error Resume Next
- Dim qd As QueryDef
- Dim iTableType As Integer
- Dim ActionQuery As String
- If cTableList = "" Then
- MsgBox "No Table Selected", 48
- Exit Sub
- End If
- gfFromSQL = False
- SetHourglass Me
- iTableType = TableType((cTableList))
- 'check to see if the selected table is
- 'actually a querydef in an Access database
- 'and display the SQL if pref is set
- If gstDataType = "MS Access" Then
- If iTableType = DB_QUERYDEF Then
- Set qd = gCurrentDB.OpenQueryDef(cTableList)
- ActionQuery = ActionQueryType((cTableList))
- If VDMDI.PrefDisplaySQL.Checked = True Then
- fSql.cSQLStatement = qd.SQL
- End If
- End If
- End If
- 'create a new dynaset form
- gstDynaString = ""
- If VDMDI.cSingleRecord = True Then
- If iTableType = DB_QUERYDEF Then
- If ActionQuery = "" Then
- MsgBar "Opening Query Dynaset", True
- Dim dsform1 As New fDynaset
- dsform1.Show
- Else
- ResetMouse Me
- If MsgBox("Run " + ActionQuery + " Query?", MSGBOX_TYPE) = YES Then
- SetHourglass Me
- MsgBar "Executing " + ActionQuery + " Query", True
- qd.Execute
- End If
- End If
- ElseIf iTableType = DB_ATTACHEDTABLE Then
- MsgBar "Opening Dynaset on Attached Table", True
- Dim dsform2 As New fDynaset
- dsform2.Show
- ElseIf iTableType = DB_ATTACHEDODBC Then
- MsgBar "Opening Dynaset on Attached ODBC Table", True
- Dim dsform3 As New fDynaset
- dsform3.Show
- ElseIf gstDataType = "ODBC" Then
- MsgBar "Opening Dynaset on ODBC Table", True
- Dim dsform4 As New fDynaset
- dsform4.Show
- Else
- MsgBar "Opening Table", True
- Dim tblform As New fTableObj
- tblform.Show
- End If
- ElseIf ActionQuery <> "" Then
- ResetMouse Me
- Beep
- MsgBox "Action Query Not Allowed w/ Data Control or Grid!", 16
- ElseIf VDMDI.cDataCtl = True Then
- MsgBar "Opening Full Table Dynaset w/ Data Control", True
- Dim dsform5 As New fDataForm
- dsform5.Show
- Else
- MsgBar "Opening Full Table Dynaset in Grid", True
- Dim dsgrid As New fGridFrm
- dsgrid.Show
- End If
- ResetMouse Me
- MsgBar "", False
- End Sub
- Sub StructButton_Click ()
- On Error Resume Next
- If cTableList = "" Then
- MsgBox "No Table Selected", 48
- Exit Sub
- End If
- gfAddTableFlag = False
- fTblStru.Show MODAL
- End Sub
- Sub TableListLabel_DblClick ()
- RefreshTables cTableList, True
- End Sub
-