home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
bp_6_93
/
bonus
/
dmsrc
/
dbform.txt
< prev
next >
Wrap
Text File
|
1995-02-26
|
3KB
|
112 lines
Option Explicit
Sub Command1_Click ()
OpenNewTableDesign
End Sub
Sub Command2_Click ()
Dim x As Integer
On Error Resume Next
If list1.ListIndex = -1 Then
MsgBox "No Table Selected: You must select a table before it can be deleted", 64, "Data Manager"
Else
x = MsgBox("Are You Sure You Want To Delete Table: """ + list1.List(list1.ListIndex) + """?", 33, "Data Manager")
If x = 1 Then
gDatabase.TableDefs.Delete list1.List(list1.ListIndex)
If Err <> 0 Then
MsgBox "Could Not Delete Table:" + Chr$(13) + Error$, 64, "Data Manager"
Exit Sub
Else
RefreshDatabaseWindow
End If
End If
End If
End Sub
Sub Command3_Click ()
On Error Resume Next 'catch case where form doesn't load
If list1.ListIndex <> -1 Then
MainForm.TableName = list1.List(list1.ListIndex)
Dim x As New DataForm
x.Show
If Err Then Exit Sub
Else
MsgBox "No Table Selected", 64, "Data Manager"
End If
End Sub
Sub command4_click ()
If list1.ListIndex <> -1 Then
If Not OpenTableDesign((list1.List(list1.ListIndex))) Then
MsgBox "Could Not Open Table Design Window.", 64, "Data Manager"
End If
Else
MsgBox "No Table Selected", 64, "Data Manager"
End If
End Sub
Sub Form_Load ()
Me.Tag = "Database"
Left = 0
Top = 0
End Sub
Sub Form_Resize ()
On Error Resume Next
Dim i As Integer
If Me.WindowState = 0 Then
If Me.Width < 2000 Then
Me.Width = 2000
End If
If Me.Height < 2070 Then
Me.Height = 2070
End If
End If
If Me.WindowState <> 1 Then
list1.Width = Me.ScaleWidth - 120 - list1.Left
list1.Height = Me.ScaleHeight - 120 - list1.Top
End If
End Sub
Sub Form_Unload (Cancel As Integer)
Dim max As Integer
Dim i As Integer
Dim abort As Integer
Dim temp As Integer
gDatabase.Close
gDatabaseName = ""
max = forms.Count - 1
i = 0
abort = False
Do While i <= max
If forms(i).Tag <> "Main" And forms(i).Tag <> "Database" Then
temp = forms.Count
Unload forms(i)
If temp = forms.Count Then
abort = True
Exit Do
End If
max = max - 1
Else
i = i + 1
End If
Loop
End Sub
Sub List1_DblClick ()
command4_click
End Sub