?? 病歷-添加.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form2
Caption = "添加病歷文檔"
ClientHeight = 7215
ClientLeft = 4650
ClientTop = 2430
ClientWidth = 6645
Icon = "病歷-添加.frx":0000
LinkTopic = "Form2"
ScaleHeight = 7215
ScaleWidth = 6645
Begin VB.Frame Frame3
Caption = " 添加檔案 "
Height = 6975
Left = 120
TabIndex = 0
Top = 120
Width = 6375
Begin VB.TextBox Text2
Height = 375
Index = 9
Left = 3240
TabIndex = 8
Top = 1680
Width = 615
End
Begin VB.TextBox Text2
Height = 375
Index = 8
Left = 2160
TabIndex = 7
Top = 1680
Width = 495
End
Begin VB.TextBox Text2
Height = 375
Index = 7
Left = 840
TabIndex = 6
Top = 1680
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 4320
Top = 3480
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database1.dat;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database1.dat;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "main"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text2
DataField = "性別"
DataSource = "Adodc1"
Height = 375
Index = 2
Left = 1440
Locked = -1 'True
TabIndex = 23
Top = 3600
Visible = 0 'False
Width = 1215
End
Begin VB.OptionButton Option2
Caption = "女"
Height = 255
Left = 1680
TabIndex = 4
Top = 1080
Width = 495
End
Begin VB.OptionButton Option1
Caption = "男"
Height = 255
Left = 960
TabIndex = 3
Top = 1080
Width = 495
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 375
Left = 4560
TabIndex = 13
Top = 6240
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "重置"
Height = 375
Left = 4560
TabIndex = 12
Top = 5640
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "確定"
Height = 375
Left = 4560
TabIndex = 11
Top = 5040
Width = 1455
End
Begin VB.TextBox Text2
DataField = "備注"
DataSource = "Adodc1"
Height = 2055
Index = 6
Left = 840
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 10
Top = 4800
Width = 3255
End
Begin VB.TextBox Text2
DataField = "病史"
DataSource = "Adodc1"
Height = 2055
Index = 5
Left = 840
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 9
Top = 2460
Width = 3255
End
Begin VB.TextBox Text2
DataField = "入院時間"
DataSource = "Adodc1"
Height = 375
Index = 4
Left = 840
TabIndex = 14
Top = 2160
Visible = 0 'False
Width = 3255
End
Begin VB.TextBox Text2
DataField = "年齡"
DataSource = "Adodc1"
Height = 375
Index = 3
Left = 2880
TabIndex = 5
Top = 960
Width = 1215
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 840
TabIndex = 1
Top = 240
Width = 1815
End
Begin VB.TextBox Text2
DataField = "ID"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Index = 0
Left = 3120
TabIndex = 2
Top = 240
Width = 975
End
Begin VB.Label Label5
Caption = "日"
Height = 255
Left = 3960
TabIndex = 26
Top = 1800
Width = 255
End
Begin VB.Label Label4
Caption = "月"
Height = 255
Left = 2880
TabIndex = 25
Top = 1800
Width = 255
End
Begin VB.Label Label2
Caption = "年"
Height = 255
Left = 1800
TabIndex = 24
Top = 1800
Width = 255
End
Begin VB.Label Label1
Height = 4095
Left = 4320
TabIndex = 22
Top = 240
Width = 1935
End
Begin VB.Label Label3
Caption = "ID:"
Height = 255
Index = 0
Left = 2760
TabIndex = 21
Top = 360
Width = 255
End
Begin VB.Label Label3
Caption = "姓名:"
Height = 255
Index = 2
Left = 240
TabIndex = 20
Top = 360
Width = 495
End
Begin VB.Label Label3
Caption = "性別:"
Height = 255
Index = 3
Left = 240
TabIndex = 19
Top = 1080
Width = 495
End
Begin VB.Label Label3
Caption = "年齡:"
Height = 255
Index = 4
Left = 2280
TabIndex = 18
Top = 1080
Width = 495
End
Begin VB.Label Label3
Caption = "入院時間"
Height = 375
Index = 5
Left = 240
TabIndex = 17
Top = 1680
Width = 375
End
Begin VB.Label Label3
Caption = "病史:"
Height = 255
Index = 6
Left = 240
TabIndex = 16
Top = 2520
Width = 495
End
Begin VB.Label Label3
Caption = "備注:"
Height = 255
Index = 7
Left = 240
TabIndex = 15
Top = 4920
Width = 495
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error GoTo adderrer
Text2(4).Text = Text2(7).Text & "-" & Text2(8).Text & "-" & Text2(9).Text
If Text2(1) = "" Or Text2(2) = "" Or Text2(3) = "" Or Text2(4) = "" Or Text2(5) = "" Or Text2(6) = "" Or Text2(7) < 0 Or Text2(7) > 9999 Or Text2(8) < 0 Or Text2(8) > 12 Or Text2(9) < 0 Or Text2(9) > 31 Then
MsgBox "信息不完整或有錯誤.,請察正后(看看注意事項)再點確定!!", vbCritical, "溫馨提示"
Else
Adodc1.Recordset.UpdateBatch
MsgBox "添加成功", , "恭喜!"
Unload Me
End If
Exit Sub
adderrer:
MsgBox "信息不完整或有錯誤.,請察正后(看看注意事項)再點確定!!", vbCritical, "溫馨提示"
Unload Me
End Sub
Private Sub Command2_Click()
Text2(1) = ""
Text2(2) = ""
Text2(3) = ""
Text2(4) = ""
Text2(5) = ""
Text2(6) = ""
Text2(7) = ""
Text2(8) = ""
Text2(9) = ""
Option1.Value = False
Option2.Value = False
Text2(1).SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim bb As Integer
Adodc1.Recordset.MoveLast
bb = Text2(0).Text
bb = Int(bb) + 1
Adodc1.Recordset.AddNew
Text2(0).Text = bb
Label1.Caption = "注意:" & Chr(13) + Chr(13) & "1.ID項為系統(tǒng)自動編號.不必也不能修改.." & Chr(13) + Chr(13) & "2.入院時間格式為XXXX-XX-XX-.." & Chr(13) + Chr(13) & "3.年齡輸入框輸入字符必須為數(shù)字" & Chr(13) + Chr(13) & "4.如有建議..歡迎指正.."
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Adodc1.Refresh
End Sub
Private Sub Option1_Click()
Text2(2).Text = Option1.Caption
End Sub
Private Sub Option2_Click()
Text2(2).Text = Option2.Caption
End Sub
Private Sub Text2_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 3 Then
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "不要告訴我你用" & Chr(34) + Chr(KeyAscii) + Chr(34) & "代表別人的年齡", vbExclamation, "溫馨提示"
KeyAscii = 0
End If
End If
If Index = 7 Then
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "不要告訴我你用" & Chr(34) + Chr(KeyAscii) + Chr(34) & "代表別人的年份", vbExclamation, "溫馨提示"
KeyAscii = 0
End If
End If
If Index = 8 Then
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "不要告訴我你用" & Chr(34) + Chr(KeyAscii) + Chr(34) & "代表別人的月份", vbExclamation, "溫馨提示"
KeyAscii = 0
End If
End If
If Index = 9 Then
If KeyAscii < 48 Or KeyAscii > 57 Then
MsgBox "不要告訴我你用" & Chr(34) + Chr(KeyAscii) + Chr(34) & "代表別人的日子", vbExclamation, "溫馨提示"
KeyAscii = 0
End If
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -