?? frmdf.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmdf
BorderStyle = 3 'Fixed Dialog
Caption = "退款登記"
ClientHeight = 1380
ClientLeft = 45
ClientTop = 330
ClientWidth = 3750
Icon = "frmdf.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
Picture = "frmdf.frx":030A
ScaleHeight = 1380
ScaleWidth = 3750
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command2
Caption = "關閉&(C)"
Height = 300
Left = 2520
TabIndex = 7
Top = 780
Width = 1000
End
Begin VB.CommandButton Command1
Caption = "退款&(R)"
Height = 300
Left = 2520
TabIndex = 6
Top = 300
Width = 1000
End
Begin VB.TextBox Text3
Height = 270
Left = 1080
TabIndex = 5
Top = 930
Width = 1200
End
Begin VB.TextBox Text2
Height = 270
Left = 1080
TabIndex = 4
Top = 570
Width = 1200
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 3
Top = 210
Width = 1200
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 2400
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.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "退款金額"
Height = 180
Left = 240
TabIndex = 2
Top = 960
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "患者姓名"
Height = 180
Left = 240
TabIndex = 1
Top = 600
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "住院證號"
Height = 180
Left = 240
TabIndex = 0
Top = 240
Width = 720
End
End
Attribute VB_Name = "frmdf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
On Error GoTo err
If Text3.text > 0 Then
With Adodc1
.RecordSource = "select * from fyjl where 住院證號='" & Text1.text & "' and 患者姓名='" & Text2.text & "' and 操作員='" & frmlogin.username & "' and 收費日期=Date()"
.Refresh
If .Recordset.AbsolutePosition = adPosUnknown Then
.Recordset.AddNew
.Recordset.Fields(1) = Text1.text
.Recordset.Fields(2) = Text2.text
.Recordset.Fields(4) = Date
.Recordset.Fields(5) = -CCur(Text3.text)
.Recordset.Fields(6) = frmlogin.username
.Recordset.UpdateBatch
Else
.Recordset.Fields(5) = .Recordset.Fields(5) - CCur(Text3.text)
.Recordset.UpdateBatch
End If
Command1.Enabled = False
End With
Else
MsgBox "退款數額不能小于或等于零!"
End If
Exit Sub
err:
MsgBox "數據庫連接失敗!"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo err3
frmdf.Top = (frmmain.Height - frmdf.Height) / 2 - 500
frmdf.Left = (frmmain.Width - frmdf.Width) / 2
Adodc1.ConnectionString = frmlogin.conn
Command1.Enabled = False
Text3.text = 0
Exit Sub
err3:
MsgBox "數據庫連接失敗!"
End Sub
Private Sub Text1_Change()
On Error GoTo err1
With Adodc1
.RecordSource = "select * from fyjl where 住院證號='" & Text1.text & "'"
.Refresh
If .Recordset.AbsolutePosition <> adPosUnknown Then
Text2.text = .Recordset.Fields(2)
Command1.Enabled = True
Else
Command1.Enabled = False
Text2.text = ""
Text3.text = 0
End If
End With
Exit Sub
err1:
MsgBox "輸入數據不正確或原始數據可能出錯!"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活動窗口:" & frmdf.Caption
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前沒有窗口被激活"
End Sub
Private Sub Text3_Change()
If Not IsNumeric(Text3.text) Or Text3.text Like "%.%" Then
MsgBox "退款金額只能填入數值!"
Text3.text = 0
Text3.SetFocus
End If
End Sub
Private Sub Text3_Click()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.text)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -