?? main_tf.frm
字號:
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 270
Left = 5670
TabIndex = 39
Top = 2865
Visible = 0 'False
Width = 945
End
Begin VB.Label Lab9
BackStyle = 0 'Transparent
Caption = "附 加 費"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 31
Top = 2835
Width = 1170
End
Begin VB.Label Lab12
BackStyle = 0 'Transparent
Caption = "備 注"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 27
Top = 3765
Width = 1335
End
Begin VB.Label Lab7
BackStyle = 0 'Transparent
Caption = "實住天數(shù) 宿費"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 26
Top = 2415
Width = 4545
End
Begin VB.Label Lab5
BackStyle = 0 'Transparent
Caption = "聯(lián)系地址"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 25
Top = 1530
Width = 1065
End
Begin VB.Label Lab4
BackStyle = 0 'Transparent
Caption = "姓 名"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 24
Top = 1095
Width = 1110
End
Begin VB.Label Lab8
BackStyle = 0 'Transparent
Caption = "%"
BeginProperty Font
Name = "宋體"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 315
Left = 9240
TabIndex = 23
Top = 2340
Width = 300
End
Begin VB.Label Lab1
BackStyle = 0 'Transparent
Caption = "憑證號碼"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 22
Top = 615
Width = 1065
End
Begin VB.Label Lab6
BackStyle = 0 'Transparent
Caption = "房 間 號 客房類型 客房價格"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 28
Top = 1965
Width = 7725
End
Begin VB.Label Lab11
BackStyle = 0 'Transparent
Caption = "實收金額 押金 退還金額"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 29
Top = 3315
Width = 7620
End
End
Begin VB.TextBox czy
BackColor = &H80000004&
BorderStyle = 0 'None
Height = 225
Left = 795
TabIndex = 7
Top = 4935
Width = 1290
End
Begin VB.CommandButton Comdj
BackColor = &H00C0C0C0&
Caption = "登記"
Height = 300
Left = 3435
Style = 1 'Graphical
TabIndex = 4
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comprint
BackColor = &H00C0C0C0&
Caption = "打印"
Enabled = 0 'False
Height = 300
Left = 7320
Style = 1 'Graphical
TabIndex = 3
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comend
BackColor = &H00C0C0C0&
Caption = "退出"
Height = 300
Left = 8610
Style = 1 'Graphical
TabIndex = 2
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comok
BackColor = &H00C0C0C0&
Caption = "確定"
Enabled = 0 'False
Height = 300
Left = 4725
Style = 1 'Graphical
TabIndex = 1
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comcancel
BackColor = &H00C0C0C0&
Caption = "取消"
Height = 300
Left = 6030
Style = 1 'Graphical
TabIndex = 0
Top = 4950
Width = 1155
End
Begin VB.Label Lab14
BackStyle = 0 'Transparent
Caption = "操作員:"
Height = 315
Left = 75
TabIndex = 6
Top = 4950
Width = 735
End
End
Attribute VB_Name = "main_tf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DBcnn As New ADODB.Connection
Dim DBrs1 As New ADODB.Recordset
Dim DBrs2 As New ADODB.Recordset
Dim DBrs3 As New ADODB.Recordset
Dim DBrs4 As New ADODB.Recordset
Dim DBrs5 As New ADODB.Recordset
Dim sqlstr As String
'定義計算住宿天數(shù)的函數(shù)
Public Sub JS()
'判斷退宿時間是否大于住宿時間
If DTP2.Value > DTP1.Value Then
'退宿時間大于住宿時間,接著判斷住宿時間是否超過中午
If tim2.Value > #11:59:00 PM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = DTP2.Value - DTP1.Value + 1
Else
Texts.Text = DTP2.Value - DTP1.Value + 0.5
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
Texts.Text = DTP2.Value - DTP1.Value
End If
Else
If tim1.Value < #2:00:00 AM# Then
If tim2.Value > #2:00:00 AM# Then
If tim2.Value > #12:00:00 PM# Then
If tim2.Value > #6:00:00 PM# Then
Texts.Text = 1 + 1
Else
Texts.Text = 1 + 0.5
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
Else
Texts.Text = 1
End If
End If
End Sub
Public Sub ssje() '定義計算實收金額和退還金額的函數(shù)
Texssje.Text = Val(Texzhje.Text) + Val(Texzf.Text) + Val(Texdhf.Text) + Val(Texpcf.Text) + Val(Texhyf.Text) + Val(Textcf.Text)
Texthje.Text = Val(Texyj.Text) - Val(Texssje.Text)
End Sub
Private Sub Form_Load()
If DBcnn.State = 0 Then
Dim connectstr As String
connectstr = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _
App.Path & "\KFGL.mdb;Persist Security Info=False"
DBcnn.CursorLocation = adUseClient
DBcnn.Open connectstr
End If
If DBrs1.State = 1 Then
DBrs1.Close
End If
sqlstr = "select * from djb"
DBrs1.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
If DBrs1.State = 1 Then
DBrs1.Close
End If
sqlstr = "select * from djb"
DBrs1.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
If DBrs2.State = 1 Then
DBrs2.Close
End If
sqlstr = "select * from kf"
DBrs2.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
If DBrs3.State = 1 Then
DBrs3.Close
End If
sqlstr = "select * from gzmx order by 日期,時間"
DBrs3.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
If DBrs4.State = 1 Then
DBrs4.Close
End If
sqlstr = "select * from djys"
DBrs4.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
If DBrs5.State = 1 Then
DBrs5.Close
End If
sqlstr = "select * from djb order by 憑證號碼"
DBrs5.Open sqlstr, DBcnn, adOpenStatic, adLockBatchOptimistic
End Sub
Private Sub Form_Activate()
czy.Text = main.StatusBar1.Panels(4).Text '賦值給czy
DTP2.Value = Date: tim2.Value = Time
'查詢住宿登記信息
sqlstr = "標志='1'"
DBrs5.Filter = sqlstr
'Data5.RecordSource = "select 憑證號碼 from djb where 標志='1'order by 憑證號碼"
'Data5.Refresh
End Sub
Private Sub Form_Unload(Cancel As Integer)
main.Enabled = True '設(shè)置主窗體有效
End Sub
Private Sub Dcomkflx_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then Dcomkfjg.SetFocus '按回車鍵Dcomkfjg獲得焦點
End Sub
Private Sub Dcomkfjg_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DTP1.SetFocus '按回車鍵DTP1獲得焦點
End Sub
Private Sub Combo2_Click()
If Combo2.Text = "折扣" Then
Texzk.Text = 100 '賦值給Texzk.text
Else
Texzk.Text = 0
End If
If Combo2.Text = "掛帳" Then
Lab10.Visible = True
Texgzdw.Visible = True
Texgzdw.Text = Texxm.Text '賦值給Texxm.text
Else
Lab10.Visible = False
Texgzdw.Visible = False '設(shè)置Texgzdw不可見
Texgzdw.Text = ""
End If
End Sub
Private Sub Combo3_Click()
Texfjf.SetFocus 'Texfjf獲得焦點
Texfjf.Text = "0" '賦值給Texfjf.text
End Sub
Private Sub Dcompzhm_Change()
'判斷輸入的憑證號碼是否為空
If Dcompzhm.Text <> "" Then
'輸入的憑證號碼不為空
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -