home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
bp_4_94
/
bonus
/
dmsrc
/
field.txt
< prev
next >
Wrap
Text File
|
1995-02-26
|
2KB
|
90 lines
Option Explicit
Sub Combo1_Click ()
If combo1.ItemData(combo1.ListIndex) = 4 Then 'Long Int
cCounter.Visible = True
Else
cCounter.Visible = False
End If
Select Case combo1.ItemData(combo1.ListIndex)
Case 10
label3.ForeColor = 0
text2.Enabled = True
Case Else
label3.ForeColor = QBColor(8)
text2.Text = ""
text2.Enabled = False
End Select
End Sub
Sub Command1_Click ()
Dim flag As Integer
flag = True
If text1 = "" Then
MsgBox "Invalid Field Name", 64, "Data Manager"
flag = False
text1.SetFocus
ElseIf combo1.ListIndex = -1 Then
MsgBox "You must select a valid field type", 64, "Data Manager"
flag = False
combo1.SetFocus
ElseIf combo1.ItemData(combo1.ListIndex) = 10 Then
If Val(text2) < 1 Or Val(text2) > 255 Then
MsgBox "Field Size (for Text Fields) must be between 1 and 255", 64, "Data Manager"
text2.SetFocus
flag = False
End If
End If
If flag Then
Me.ExitCondition = "OK"
Me.Hide
Me.FName = text1
Me.fType = combo1.ItemData(combo1.ListIndex)
If Me.fType = 10 Then
Me.FSize = text2
Else
Me.FSize = 0
End If
End If
End Sub
Sub Command2_Click ()
Me.ExitCondition = "Cancel"
Me.Hide
End Sub
Sub Form_Load ()
combo1.AddItem "Boolean"
combo1.AddItem "Byte"
combo1.AddItem "Integer"
combo1.AddItem "Long Integer"
combo1.AddItem "Currency"
combo1.AddItem "Single"
combo1.AddItem "Double"
combo1.AddItem "Date/Time"
combo1.AddItem "Text"
combo1.AddItem "Binary"
combo1.AddItem "Memo"
combo1.ItemData(0) = 1
combo1.ItemData(1) = 2
combo1.ItemData(2) = 3
combo1.ItemData(3) = 4
combo1.ItemData(4) = 5
combo1.ItemData(5) = 6
combo1.ItemData(6) = 7
combo1.ItemData(7) = 8
combo1.ItemData(8) = 10
combo1.ItemData(9) = 11
combo1.ItemData(10) = 12
End Sub