📄 chooseitem1.frm
字号:
Begin VB.Label Label9
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "吸烟"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 2040
TabIndex = 18
Top = 3000
Width = 495
End
Begin VB.Label Label8
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "曾获奖项"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 735
Left = 2040
TabIndex = 16
Top = 1440
Width = 495
End
Begin VB.Label Label7
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "性格"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 615
Left = 120
TabIndex = 14
Top = 3000
Width = 495
End
Begin VB.Label Label6
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "活动参与程度"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 975
Left = 4200
TabIndex = 11
Top = 2880
Width = 495
End
Begin VB.Label Label5
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "Label5"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 135
Left = 240
TabIndex = 10
Top = 1200
Width = 15
End
Begin VB.Label Label4
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "缺课"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 4200
TabIndex = 9
Top = 1440
Width = 495
End
Begin VB.Label Label3
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "年龄"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 120
TabIndex = 8
Top = 2040
Width = 495
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "性别"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 120
TabIndex = 7
Top = 1320
Width = 495
End
Begin VB.Label name
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "输入姓名"
ForeColor = &H00404040&
Height = 255
Left = 120
TabIndex = 6
Top = 120
Width = 1695
End
Begin VB.Label Label1
Appearance = 0 'Flat
BackColor = &H00FFC0C0&
Caption = "在以下列表中选择适合自已的项目"
ForeColor = &H00404040&
Height = 375
Left = 120
TabIndex = 0
Top = 480
Width = 4095
End
End
Attribute VB_Name = "chooseitem1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim record As Recordset
Dim custernum As Integer
Dim custername As String
Dim result As String
Dim cases As String
Dim advice As String
Dim advice1 As String
Dim advice2 As String
Dim advice3 As String
Dim advice4 As String
Dim advice5 As String
Dim t As Integer
Dim sex As Integer
Dim age As Integer
Dim weight As Integer
Dim bloodpressure As Integer
Dim mentalcondition As Integer
Dim heridity As Integer
Dim smoking As Integer
Dim foods As Integer
Dim phsicalexercise As Integer
Private Sub Command1_Click()
Set db = OpenDatabase(datapath)
see = "select * from custerms"
Set record = db.OpenRecordset(see)
'Set record = db.OpenRecordset("custerms")
If record.RecordCount <> 0 Then
record.MoveLast
custernum = record("custernum") + 1
Else
usternum = 1
End If
record.AddNew
record("custernum") = custernum
record("custername") = custername
record("sex") = sex
record("age") = age
record("smoking") = smoking
record("mentalcondition") = mentalcondition
record("heridity") = heridity
record("weight") = weight
record("bloodpressure") = bloodpressure
record("foods") = foods
record("phsicalexercise") = phsicalexercise
' record.Update
db.Close
Text1.Text = ""
t = 0
t = t + sex
t = t + age
t = t + mentalcondition
t = t + heridity
t = t + smoking
t = t + weight
t = t + bloodpressure
t = t + foods
t = t + phsicalexercise
If (t <= 10) Then
cases = "你是一个中等偏下的学生。"
GoTo loop2
End If
If (t <= 15) Then
cases = "你是一个中等偏上的学生。"
GoTo loop2
End If
If (t <= 20) Then
cases = "你是一个良好的学生。"
GoTo loop2
End If
cases = "你是一个优秀的学生。"
loop2:
Label13.FontSize = 12
Label13.Caption = cases
If (mentalcondition = 1) Then advice1 = "多与人沟通"
If (smoking < 2) Then advice2 = "戒烟."
If (weight < 2) Then advice3 = "认真做好上课安排,按老师的要求做."
If (bloodpressure <= 1) Then advice4 = "请多参加集体活动,加强锻炼."
If (foods < 2) Then advice5 = "放松心情,调整心态."
' (phsicalexercise = 1) Then advice6 = "加强锻炼."
Picture1.FontSize = 12
Picture1.Print advice1; advice2; advice3
Picture1.Print advice4; advice5;
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label13.Caption = ""
Picture1.Cls
List1.ListIndex = -1
List2.ListIndex = -1
List3.ListIndex = -1
List4.ListIndex = -1
List5.ListIndex = -1
List6.ListIndex = -1
List7.ListIndex = -1
List8.ListIndex = -1
List9.ListIndex = -1
End Sub
Private Sub Command3_Click()
chooseitem1.Hide
formcover1.Show
End Sub
Private Sub Form_Load()
List1.AddItem "男性"
List1.AddItem "女性"
List2.AddItem "大于30岁"
List2.AddItem "25至30岁"
List2.AddItem "22至25岁"
List2.AddItem "20至22岁"
List2.AddItem "小于18岁"
List3.AddItem "基本不上课"
List3.AddItem "经常"
List3.AddItem "有时"
List3.AddItem "无"
List4.AddItem "不参加课外活动"
List4.AddItem "有时参加一两项课外活动 "
List4.AddItem "积极参加课外活动"
List8.AddItem "经常"
List8.AddItem "有时"
List8.AddItem "无"
List9.AddItem "娱乐"
List9.AddItem "艺术"
List9.AddItem "体育"
List9.AddItem "绘画"
List9.AddItem "文学"
List5.AddItem "多变,难以捉摸"
List5.AddItem "内向,沉默"
List5.AddItem "内外皆有"
List5.AddItem "开朗,外向,活泼,幽默"
List6.AddItem "无"
List6.AddItem "获过一至多项体育奖项"
List6.AddItem "进步生"
List6.AddItem "班干部"
List6.AddItem "系三好生"
List6.AddItem "院三好生"
List6.AddItem "省三好生"
List7.AddItem "每天40支"
List7.AddItem "每天20支"
List7.AddItem "每天10支"
List7.AddItem "不吸"
Label13.Caption = ""
Text1.Text = ""
End Sub
Private Sub list1_Click()
sex = List1.ListIndex
End Sub
Private Sub list2_Click()
age = List2.ListIndex
End Sub
Private Sub List3_Click()
weight = List3.ListIndex
End Sub
Private Sub List4_Click()
bloodpressure = List4.ListIndex
End Sub
Private Sub List5_Click()
mentalcondition = List5.ListIndex
End Sub
Private Sub List6_Click()
heridity = List6.ListIndex
End Sub
Private Sub List7_Click()
smoking = List7.ListIndex
End Sub
Private Sub List8_Click()
foods = List8.ListIndex
End Sub
Private Sub List9_Click()
phsicalexercise = List9.ListIndex
End Sub
Private Sub Text1_Change()
custername = Text1.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -