📄 main_ysgl_update.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Main_Ysgl_Update
BackColor = &H00E3D9E6&
ClientHeight = 4665
ClientLeft = 60
ClientTop = 60
ClientWidth = 6795
ControlBox = 0 'False
LinkTopic = "Form1"
ScaleHeight = 4665
ScaleWidth = 6795
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
BackColor = &H00FFC0C0&
Caption = "修改医生信息"
BeginProperty Font
Name = "隶书"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 3750
Left = 210
TabIndex = 2
Top = 210
Width = 6390
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 285
Index = 0
Left = 1035
Locked = -1 'True
TabIndex = 10
Top = 615
Width = 2055
End
Begin VB.TextBox Text1
Height = 285
Index = 1
Left = 1035
TabIndex = 9
Top = 1020
Width = 2055
End
Begin VB.TextBox Text1
Height = 285
Index = 2
Left = 1035
TabIndex = 7
Top = 1440
Width = 2055
End
Begin VB.ComboBox Combo1
Height = 300
Left = 3705
TabIndex = 6
Top = 1440
Width = 2370
End
Begin VB.TextBox Text1
Height = 285
Index = 4
Left = 1035
TabIndex = 5
Top = 1875
Width = 2055
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
Height = 285
Index = 5
Left = 3705
TabIndex = 4
Top = 1860
Width = 2370
End
Begin VB.TextBox Text1
Height = 285
Index = 6
Left = 1020
TabIndex = 3
Top = 2310
Width = 5040
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "Main_Ysgl_Update.frx":0000
Height = 330
Left = 1035
TabIndex = 8
Top = 2730
Width = 5040
_ExtentX = 8890
_ExtentY = 582
_Version = 393216
ListField = "科室名称"
Text = ""
End
Begin MSDataListLib.DataCombo DataCombo2
Bindings = "Main_Ysgl_Update.frx":0015
Height = 330
Left = 1035
TabIndex = 11
Top = 3180
Width = 5040
_ExtentX = 8890
_ExtentY = 582
_Version = 393216
ListField = "科室名称"
Text = ""
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "医生姓名"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 20
Top = 1080
Width = 765
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "医生编号 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 19
Top = 675
Width = 870
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "所在科室"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 18
Top = 2790
Width = 765
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "兼职科室 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 17
Top = 3210
Width = 765
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "拼音码"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 16
Top = 1485
Width = 765
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "性别"
ForeColor = &H00FF0000&
Height = 330
Left = 3210
TabIndex = 15
Top = 1485
Width = 765
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "职称 "
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 14
Top = 1905
Width = 870
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "职务"
ForeColor = &H00FF0000&
Height = 330
Left = 3210
TabIndex = 13
Top = 1890
Width = 765
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "联系电话"
ForeColor = &H00FF0000&
Height = 330
Left = 240
TabIndex = 12
Top = 2340
Width = 765
End
End
Begin VB.CommandButton CmdCancel
Caption = "(&C)取消"
Height = 375
Left = 3435
TabIndex = 0
Top = 4110
Width = 1830
End
Begin VB.CommandButton CmdSave
Caption = "(&M)修改"
Height = 375
Left = 1620
TabIndex = 1
Top = 4110
Width = 1830
End
Begin MSAdodcLib.Adodc Adodc1
Height = 345
Left = -915
Top = 2295
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 609
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MZJJSFXT"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=MZJJSFXT"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 科室信息表"
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
End
Attribute VB_Name = "Main_Ysgl_Update"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim i As Integer
Dim SQL As String
Private Sub Form_Activate()
Text1(1).SetFocus
End Sub
Private Sub Form_Load()
Combo1.AddItem ("男")
Combo1.AddItem ("女")
For i = 0 To 2
'对应列
Main_Ysgl.MSHFlexGrid1.Col = i
Text1(i) = Main_Ysgl.MSHFlexGrid1.Text
Next i
Main_Ysgl.MSHFlexGrid1.Col = 3
Combo1.Text = Main_Ysgl.MSHFlexGrid1.Text
For i = 4 To 6
'对应列
Main_Ysgl.MSHFlexGrid1.Col = i
Text1(i) = Main_Ysgl.MSHFlexGrid1.Text
Next i
Main_Ysgl.MSHFlexGrid1.Col = 7
DataCombo1.Text = Main_Ysgl.MSHFlexGrid1.Text
Main_Ysgl.MSHFlexGrid1.Col = 8
DataCombo2.Text = Main_Ysgl.MSHFlexGrid1.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
GotFocusBC Text1(Index)
End Sub
Private Sub Text1_LostFocus(Index As Integer)
LostFocusBC Text1(Index)
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Index = 1 And KeyCode = vbKeyReturn Then DataCombo1.SetFocus
End Sub
Private Sub DataCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DataCombo2.SetFocus
End Sub
Private Sub CmdSave_Click()
Dim cn As New ADODB.Connection
cn.Open cnn
If Text1(0).Text = "" Then
MsgBox "系统不允许医生姓名为空!"
Exit Sub
End If
'生成SQL语句
SQL = "UPDATE 医生信息表 SET 姓名 ='" + Text1(1).Text + "',拼音码 ='" + Text1(2).Text + "',性别 ='" + Combo1.Text + "',职称 ='" + Text1(4).Text + "',职务='" + Text1(5).Text + "',联系电话 ='" + Text1(6).Text + "',所在科室 = '" + DataCombo1.Text + "',兼职科室= '" + DataCombo2.Text + "' WHERE 编号='" + Text1(0).Text + "'"
'执行SQL
cn.Execute SQL
cn.Close
Main_Ysgl.Adodc1.Refresh
Unload Me
EnaT Main_Ysgl
End Sub
Private Sub CmdCancel_Click()
EnaT Main_Ysgl
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -