📄 frmxjf.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmxjf
BackColor = &H00404040&
BorderStyle = 3 'Fixed Dialog
Caption = "续交住院费"
ClientHeight = 1845
ClientLeft = 45
ClientTop = 330
ClientWidth = 4200
Icon = "frmxjf.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "frmxjf.frx":030A
ScaleHeight = 1845
ScaleWidth = 4200
ShowInTaskbar = 0 'False
Begin MSAdodcLib.Adodc Adodc2
Height = 330
Left = 2280
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
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.CommandButton Command4
Caption = "打印&(P)"
Height = 300
Left = 2760
TabIndex = 11
Top = 975
Width = 1100
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 0
Top = 0
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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 Text4
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 1155
TabIndex = 10
Top = 1320
Width = 1000
End
Begin VB.CommandButton Command3
Caption = "关闭&(C)"
Height = 300
Left = 2760
TabIndex = 8
Top = 1350
Width = 1100
End
Begin VB.CommandButton Command2
Caption = "保存&(S)"
Height = 300
Left = 2760
TabIndex = 7
Top = 600
Width = 1100
End
Begin VB.CommandButton Command1
Caption = "续费&(W)"
Height = 300
Left = 2760
TabIndex = 6
Top = 225
Width = 1100
End
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 1150
Locked = -1 'True
TabIndex = 5
Top = 960
Width = 1000
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 1150
Locked = -1 'True
TabIndex = 4
Top = 600
Width = 1000
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
ForeColor = &H000000FF&
Height = 270
Left = 1150
TabIndex = 3
Top = 240
Width = 1000
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "续交金额"
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 9
Top = 1365
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "预交金额"
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 2
Top = 1005
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "患者姓名"
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 1
Top = 650
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00404040&
BackStyle = 0 'Transparent
Caption = "住院证号"
ForeColor = &H00000000&
Height = 180
Left = 360
TabIndex = 0
Top = 300
Width = 720
End
End
Attribute VB_Name = "frmxjf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Command2.Enabled = True
Text4.Enabled = True
Command1.Enabled = False
End Sub
Private Sub Command2_Click()
On Error GoTo err2
Dim ks As String
If Text4.text = 0 Then
MsgBox "续交金额用不能为零!"
Else
With Adodc1
.RecordSource = "select 住院证号,患者姓名,科室类别,预交费,费用合计,欠费,退费 from zyf where 住院证号='" & Text1.text & "' and 患者姓名='" & Text2.text & "'"
.Refresh
If .Recordset.AbsolutePosition = adPosUnknown Then
MsgBox "该患者不存在,请检查住院证号和姓名!"
Else
ks = .Recordset.Fields("科室类别")
.Recordset.Fields("预交费") = .Recordset.Fields("预交费") + CCur(Text4.text)
If (.Recordset.Fields("预交费") - .Recordset.Fields("费用合计")) >= 0 Then
.Recordset.Fields("退费") = .Recordset.Fields("预交费") - .Recordset.Fields("费用合计")
.Recordset.Fields("欠费") = 0
Else
.Recordset.Fields("欠费") = (-1) * (.Recordset.Fields("预交费") - .Recordset.Fields("费用合计"))
.Recordset.Fields("退费") = 0
End If
.Recordset.Update
With Adodc2
.RecordSource = "select * from fyjl where 住院证号='" & Text1.text & "'and 操作员='" & frmlogin.username & "'and 患者姓名='" & Text2.text & "' and 收费日期=date() "
.Refresh
If .Recordset.AbsolutePosition = adPosUnknown Then
.Recordset.AddNew
.Recordset.Fields(1) = Text1.text
.Recordset.Fields(2) = Text2.text
.Recordset.Fields(3) = ks
.Recordset.Fields(4) = Date
.Recordset.Fields(5) = Text4.text
.Recordset.Fields(6) = frmlogin.username
.Recordset.UpdateBatch
Else
.Recordset.Fields(5) = CCur(Text4.text) + .Recordset.Fields(5)
.Recordset.UpdateBatch
End If
End With
End If
End With
Text1.text = ""
Text2.text = ""
Text3.text = ""
Text4.text = 0
Command2.Enabled = False
Text4.Enabled = False
End If
Exit Sub
err2:
MsgBox "无法预知的错误!"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活动窗口:" & frmxjf.Caption
End Sub
Private Sub Form_Load()
On Error GoTo err3
frmxjf.Top = (frmmain.Height - frmxjf.Height) / 2 - 500
frmxjf.Left = (frmmain.Width - frmxjf.Width) / 2
Text4.text = 0
Command1.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Text4.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Adodc1.ConnectionString = frmlogin.conn
Adodc2.ConnectionString = frmlogin.conn
Exit Sub
err3:
MsgBox "数据库连接失败!"
End Sub
Private Sub Text4_LostFoucs()
If Not IsNumeric(Text4.text) Or Text4.text Like "%.%" Then
MsgBox "预交金额只能填入数值!"
Text4.SetFocus
End If
End Sub
Private Sub Text1_Change()
On Error GoTo err1
Text4.text = 0
With Adodc1
.RecordSource = "select 住院证号,患者姓名,预交费 from zyf where 住院证号='" & Text1.text & "' and 出院标记=false"
.Refresh
If Adodc1.Recordset.AbsolutePosition <> adPosUnknown Then
Text2.text = Adodc1.Recordset.Fields("患者姓名")
Text3.text = Adodc1.Recordset.Fields("预交费")
Command1.Enabled = True
Else
Command1.Enabled = False
Text4.Enabled = False
Text2.text = ""
Text3.text = ""
End If
End With
Exit Sub
err1:
MsgBox "输入数据不正确或原始数据可能出错!"
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.text)
End Sub
Private Sub Text4_GotFocus()
Text4.SelStart = 0
Text4.SelLength = Len(Text4.text)
End Sub
Private Sub Text4_Change()
If Not IsNumeric(Text4.text) Or Text4.text Like "%.%" Then
MsgBox "退款金额只能填入数值!"
Text4.text = 0
Text4.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -