📄 skrz.frm
字号:
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Index = 1
Left = 6240
TabIndex = 14
Top = 1080
Width = 495
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "散客入住登记表"
BeginProperty Font
Name = "楷体_GB2312"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00808000&
Height = 375
Index = 0
Left = 2880
TabIndex = 13
Top = 960
Width = 3015
End
Begin VB.Shape Shape1
BackColor = &H00C0E0FF&
BorderColor = &H80000010&
Height = 4935
Left = 120
Top = 840
Width = 8295
End
Begin VB.Shape Shape2
BorderColor = &H80000010&
Height = 3855
Left = 240
Top = 1440
Width = 8055
End
Begin VB.Menu MNU1
Caption = "文件(&F)"
Begin VB.Menu MNU11
Caption = "打印设置"
End
Begin VB.Menu MNU12
Caption = "打印预览"
End
Begin VB.Menu MNU13
Caption = "打印 "
Shortcut = ^P
End
Begin VB.Menu MNU15
Caption = "-"
End
Begin VB.Menu MNU16
Caption = "退出(&E)"
End
End
Begin VB.Menu MNU2
Caption = "编辑(&E)"
Begin VB.Menu MNU21
Caption = "增加 "
Shortcut = ^A
End
Begin VB.Menu MNU26
Caption = "修改"
Shortcut = ^E
End
Begin VB.Menu MNU23
Caption = "取消"
Enabled = 0 'False
Shortcut = ^U
End
Begin VB.Menu MNU28
Caption = "保存"
Enabled = 0 'False
Shortcut = ^S
End
Begin VB.Menu MNU24
Caption = "-"
End
Begin VB.Menu MNU22
Caption = "删除 "
Shortcut = ^D
End
Begin VB.Menu MNU25
Caption = "-"
End
Begin VB.Menu MNU27
Caption = "预订散客入住"
Shortcut = {F3}
End
End
Begin VB.Menu MNU3
Caption = "查看(&V)"
End
Begin VB.Menu MNU4
Caption = "计算器(&J)"
End
Begin VB.Menu MNU5
Caption = "帮助(&H)"
Begin VB.Menu MNU51
Caption = "帮助主题"
Shortcut = {F1}
End
Begin VB.Menu MNU53
Caption = "-"
End
Begin VB.Menu MNU54
Caption = "关于红日软件..."
End
End
End
Attribute VB_Name = "SKRZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim DATJDGL As Database
Dim RECHJZT As Recordset
Dim RECYD As Recordset
Dim RECKRZD As Recordset
Private Sub Combo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub
Private Sub Combo3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
If Action = 11 Then
If Me.MNU28.Enabled Then
If MsgBox("当前数据没有保存!请确认是否放弃?", vbQuestion + vbYesNo, "提示信息") = vbNo Then
Action = 0
Save = 0
Exit Sub
Else
Save = 0
End If
End If
End If
End Sub
Private Sub DBCombo1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
SendKeys "{TAB}"
KeyAscii = 0
End If
End Sub
Private Sub Data1_Reposition()
Label5.Caption = Format(Label5.Caption, "long date")
Label6.Caption = Format(Label6.Caption, "long date")
If IsNumeric(Text3.Text) Then Text3.Text = FormatNumber(Text3.Text, 2, vbTrue, , vbFalse)
If IsNumeric(Text5.Text) Then Text5.Text = FormatNumber(Text5.Text, 2, vbTrue, , vbFalse)
If IsNumeric(Text5.Text) Then
If CDbl(Text5.Text) <> 0 Then
Label2(7).Caption = "<大写>人民币" + SUMDM(CDbl(Text5.Text))
Else
Label2(7).Caption = "<大写>"
End If
End If
Data2.DatabaseName = App.Path & "\data\jdgl.mdb"
Data2.Refresh
End Sub
Private Sub DBGrid1_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
If Button = vbRightButton Then
Me.PopupMenu POP1
End If
End Sub
Private Sub dbFind1_Selected(SelectValue As Variant)
Data3.Recordset.FindFirst ("房情 ='" & SelectValue & "'")
Text8.Text = Data3.Recordset("房号")
If IsNull(Data3.Recordset("房价")) Then
Text3.Text = FormatNumber(0, 2, vbTrue, , vbFalse)
Else
Text3.Text = FormatNumber(Data3.Recordset("房价"), 2, vbTrue, , vbFalse)
End If
Text8.SetFocus
End Sub
Private Sub DTPicker1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Label5.Caption = Format(DTPicker1.Value, "long date")
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker1_Validate(Cancel As Boolean)
Label5.Caption = Format(DTPicker1.Value, "long date")
Label3.Caption = DTPicker1.Value
End Sub
Private Sub DTPicker2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Label6.Caption = Format(DTPicker2.Value, "long date")
SendKeys "{TAB}"
End If
End Sub
Private Sub DTPicker2_Validate(Cancel As Boolean)
Label6.Caption = Format(DTPicker2.Value, "long date")
End Sub
Private Sub Form_Activate()
If Data1.Recordset.RecordCount = 0 Then
MNU21_Click
Data1.UpdateRecord
Data1.Recordset.MoveFirst
End If
Label5.Caption = Format(Label5.Caption, "long date")
Label6.Caption = Format(Label6.Caption, "long date")
If IsNumeric(Text3.Text) Then Text3.Text = FormatNumber(Text3.Text, 2, vbTrue, , vbFalse)
If IsNumeric(Text5.Text) Then Text5.Text = FormatNumber(Text5.Text, 2, vbTrue, , vbFalse)
If IsNumeric(Text5.Text) Then
If CDbl(Text5.Text) <> 0 Then
Label2(7).Caption = "<大写>人民币" + SUMDM(CDbl(Text5.Text))
Else
Label2(7).Caption = "<大写>"
End If
End If
dbFind1.Refresh
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\data\jdgl.mdb"
Data2.DatabaseName = App.Path & "\data\jdgl.mdb"
Data3.DatabaseName = App.Path & "\data\jdgl.mdb"
Data1.Refresh
Data2.Refresh
Data3.Refresh
Set DATJDGL = OpenDatabase(App.Path & "\DATA\JDGL.MDB")
Set RECHJZT = DATJDGL.OpenRecordset("房间状态", dbOpenDynaset)
Set RECKRZD = DATJDGL.OpenRecordset("客人帐单", dbOpenDynaset)
With dbFind1
.DatabaseName = Data3.DatabaseName
.RecordSource = Data3.RecordSource
.Refresh
.BoundColumn = "房号"
.ListField = "房情"
.Refresh
End With
dbFind1.Caption = "请选择入住房号"
End Sub
Private Sub Form_Unload(Cancel As Integer)
DATJDGL.Close
End Sub
Private Sub MNU11_Click() '打印机设置
CDLTEST.flags = cdlPDDisablePrintToFile
CDLTEST.Copies = 3
CDLTEST.PrinterDefault = True
CDLTEST.ShowPrinter
End Sub
Private Sub MNU12_Click()
SKRZPREVIEW.Show vbModal
End Sub
Private Sub MNU13_Click()
SKRZPREVIEW.Toolbar1_ButtonClick SKRZPREVIEW.Toolbar1.Buttons(2)
SKRZPREVIEW.Toolbar1_ButtonClick SKRZPREVIEW.Toolbar1.Buttons(1)
Unload SKRZPREVIEW
End Sub
Private Sub MNU16_Click() ' 退出模块
Unload Me
End Sub
Private Sub MNU21_Click()
On Error GoTo EXITSUB
Dim maxrec As Recordset
Dim RECNO As String
RECNO = ""
If Data1.Recordset.EditMode = 2 Then
If MsgBox("本卡是新增卡!请确认是否继续增加?", vbQuestion + vbYesNo, "提示信息") = vbYes Then
If Text8.Text = "" And Data1.Recordset.RecordCount > 0 Then
MsgBox "请录入当前客人所住房号!", vbCritical, "错误信息"
Text8.SetFocus
Exit Sub
End If
RECNO = Text6.Text
RECNO = left(RECNO, 8) + right(Trim(CStr(CLng(right(RECNO, 4)) + 10001)), 4)
Else
Exit Sub
End If
Else
Set maxrec = DATJDGL.OpenRecordset("SELECT DISTINCTROW Max(散客登记表.客人ID) AS 客人ID From 散客登记表 HAVING (((Left([客人ID],8))=CStr(Year(Now()))+Right(CStr(100+Month(Now())),2)+Right(CStr(100+Day(Now())),2)))", dbOpenSnapshot)
RECNO = IIf(Not IsNull(maxrec("客人ID")), maxrec("客人ID"), "")
Set maxrec = DATJDGL.OpenRecordset("SELECT DISTINCTROW Max(散客结帐.客人ID) AS 客人ID From 散客结帐 HAVING (((Left([客人ID],8))=CStr(Year(Now()))+Right(CStr(100+Month(Now())),2)+Right(CStr(100+Day(Now())),2)))", dbOpenSnapshot)
If Not IsNull(maxrec("客人ID")) Then
If RECNO < maxrec("客人ID") Then RECNO = maxrec("客人ID")
End If
If RECNO <> "" Then
RECNO = left(RECNO, 8) + right(Trim(CStr(CLng(right(RECNO, 4)) + 10001)), 4)
Else
RECNO = CStr(Year(Now())) + IIf(Len(CStr(Month(Now()))) = 1, "0" + CStr(Month(Now())), CStr(Month(Now()))) + IIf(Len(CStr(Day(Now()))) = 1, "0" + CStr(Day(Now())), CStr(Day(Now()))) + "0001"
End If
maxrec.Close
End If
dbFind1.Find
If dbFind1.Value = " " Then Exit Sub
Data3.Recordset.FindFirst ("房情 ='" & dbFind1.Value & "'")
If Data1.Recordset.RecordCount = 0 Then
Data1.Refresh
Else
Data1.UpdateRecord
End If
Data1.Recordset.AddNew
Data1.Recordset("住房") = True
Data1.Recordset("班次") = frmLogin.CZYBC
Text6.Text = RECNO
DTPicker1.Value = Now
Label3.Caption = Now
DTPicker2.Value = Now + 1
Text8.Text = Data3.Recordset("房号")
If IsNull(Data3.Recordset("房价")) Then
Text3.Text = FormatNumber(0, 2, vbTrue, , vbFalse)
Else
Text3.Text = FormatNumber(Data3.Recordset("房价"), 2, vbTrue, , vbFalse)
End If
Text9.Text = frmLogin.CZYXM
Chang
Text2.SetFocus
Exit Sub
EXITSUB:
MsgBox CStr(Err.Number) & "-" & Err.Description, vbCritical, "提示信息"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -