📄 main_tf.frm
字号:
TabIndex = 44
Top = 570
Width = 975
End
Begin VB.Label Lab10
BackStyle = 0 'Transparent
Caption = "挂账单位"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 270
Left = 5670
TabIndex = 41
Top = 2865
Visible = 0 'False
Width = 945
End
Begin VB.Label Lab9
BackStyle = 0 'Transparent
Caption = "附 加 费"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 33
Top = 2835
Width = 1170
End
Begin VB.Label Lab12
BackStyle = 0 'Transparent
Caption = "备 注"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 29
Top = 3765
Width = 1335
End
Begin VB.Label Lab7
BackStyle = 0 'Transparent
Caption = "实住天数 宿费"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 28
Top = 2415
Width = 4545
End
Begin VB.Label Lab5
BackStyle = 0 'Transparent
Caption = "联系地址"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 27
Top = 1530
Width = 1065
End
Begin VB.Label Lab4
BackStyle = 0 'Transparent
Caption = "姓 名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 26
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 = 25
Top = 2340
Width = 300
End
Begin VB.Label Lab1
BackStyle = 0 'Transparent
Caption = "凭证号码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 24
Top = 615
Width = 1065
End
Begin VB.Label Lab6
BackStyle = 0 'Transparent
Caption = "房 间 号 客房类型 客房价格"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 210
TabIndex = 30
Top = 1965
Width = 7725
End
Begin VB.Label Lab11
BackStyle = 0 'Transparent
Caption = "实收金额"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 210
TabIndex = 31
Top = 3315
Width = 1095
End
End
Begin VB.CommandButton Comdj
BackColor = &H8000000B&
Caption = "登记"
Height = 345
Left = 3450
Style = 1 'Graphical
TabIndex = 4
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comprint
Caption = "打印"
Enabled = 0 'False
Height = 345
Left = 7305
Style = 1 'Graphical
TabIndex = 3
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comend
Caption = "退出"
Height = 345
Left = 8610
Style = 1 'Graphical
TabIndex = 2
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comok
BackColor = &H8000000B&
Caption = "确定"
Enabled = 0 'False
Height = 345
Left = 4710
Style = 1 'Graphical
TabIndex = 1
Top = 4950
Width = 1155
End
Begin VB.CommandButton Comcancel
Caption = "取消"
Height = 345
Left = 6030
Style = 1 'Graphical
TabIndex = 0
Top = 4950
Width = 1155
End
End
Attribute VB_Name = "main_tf"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Sub JS() '定义计算住宿天数的函数
If DTP2.Value > DTP1.Value Then
'DateTimePicker控件DateTimePicker控件使您可以提供格式化的日期字段,使得进行日期选择很容易。
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() '定义计算实收金额和退还金额的函数
If Combo2.text = "挂账" Then
Texssje.text = Val(Texzhje.text) + Val(Texzf.text) + Val(Texdhf.text) + Val(Texpcf.text) + Val(Texhyf.text) + Val(Textcf.text) - Val(Texyj.text)
Else
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)
'Val 函数返回包含于字符串内的数字,字符串中是一个适当类型的数值。
End If
End Sub
Private Sub Form_Load()
'自动识别数据库路径
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from tb_djb"
Adodc1.Refresh
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc2.RecordSource = "select * from tb_kf"
Adodc2.Refresh
Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc3.RecordSource = "select * from tb_gzmx"
Adodc3.Refresh
Adodc4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc4.RecordSource = "select * from tb_djys"
Adodc4.Refresh
Adodc5.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DB_KFGL.mdb;Persist Security Info=False"
Adodc5.RecordSource = "select 凭证号码 from tb_djb where 标志='1'order by 凭证号码"
Adodc5.Refresh
If Adodc5.Recordset.RecordCount > 0 Then
For i = 1 To Adodc5.Recordset.RecordCount
Combo4.AddItem Adodc5.Recordset.Fields("凭证号码").Value
Adodc5.Recordset.MoveNext
Next i
End If
End Sub
Private Sub Form_Activate()
czy.text = Main.StatusBar1.Panels(4).text '赋值给czy
DTP2.Value = Date: tim2.Value = Time
End Sub
Private Sub Form_Unload(Cancel As Integer)
Main.Enabled = True '设置主窗体有效
End Sub
Private Sub DBCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then DBCombo2.SetFocus '按回车键DBCombo2获得焦点
End Sub
Private Sub DBCOMBO2_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
End If
If Combo2.text = "招待" Then
Texssje.text = 0: Texthje.text = Texyj.text
End If
If Combo2.text = "挂账" Then
Lab10.Visible = True
Texgzdw.Visible = True
Texgzdw.text = Texxm.text '赋值给Texxm.text
Lab11.Caption = "欠款金额": Label3.Visible = False: Texthje.Visible = False
Texzk.text = 100 '赋值给Texzk.text
Texssje.text = Val(Texzhje.text) - Val(Texyj.text) + Val(Texzf.text) + Val(Texdhf.text) + Val(Texpcf.text) + Val(Texhyf.text) + Val(Textcf.text)
Else
Lab11.Caption = "实收金额": Label3.Visible = True: Texthje.Visible = True
Lab10.Visible = False
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -