⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmtel.frm

📁 1:首先要导入hotel数据
💻 FRM
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmTel 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "话费入帐"
   ClientHeight    =   3165
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4860
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3165
   ScaleWidth      =   4860
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame frmTel 
      Caption         =   "话费信息"
      Height          =   1750
      Left            =   160
      TabIndex        =   2
      Top             =   840
      Width           =   4575
      Begin VB.TextBox txtRoomId 
         Height          =   270
         Left            =   840
         MaxLength       =   4
         TabIndex        =   7
         Top             =   600
         Width           =   1215
      End
      Begin VB.TextBox txtPrice 
         Height          =   270
         IMEMode         =   3  'DISABLE
         Left            =   840
         MaxLength       =   4
         TabIndex        =   6
         Top             =   1320
         Width           =   1215
      End
      Begin VB.TextBox txtName 
         BackColor       =   &H8000000F&
         Height          =   270
         Left            =   840
         Locked          =   -1  'True
         TabIndex        =   5
         Top             =   960
         Width           =   1215
      End
      Begin VB.TextBox Text4 
         Height          =   1360
         Left            =   2280
         MultiLine       =   -1  'True
         TabIndex        =   4
         ToolTipText     =   "备注信息"
         Top             =   240
         Width           =   2055
      End
      Begin VB.TextBox txtconid 
         Height          =   495
         Left            =   3600
         TabIndex        =   3
         Top             =   480
         Visible         =   0   'False
         Width           =   735
      End
      Begin MSComCtl2.DTPicker DTPicker1 
         Height          =   255
         Left            =   840
         TabIndex        =   8
         Top             =   240
         Width           =   1215
         _ExtentX        =   2143
         _ExtentY        =   450
         _Version        =   393216
         Format          =   61734913
         CurrentDate     =   38353
      End
      Begin VB.Label Label1 
         Caption         =   "日 期"
         Height          =   255
         Index           =   0
         Left            =   240
         TabIndex        =   12
         Top             =   300
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "姓 名"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   11
         Top             =   1020
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "房 号"
         Height          =   255
         Index           =   2
         Left            =   240
         TabIndex        =   10
         Top             =   660
         Width           =   495
      End
      Begin VB.Label Label1 
         Caption         =   "金 额"
         Height          =   255
         Index           =   3
         Left            =   240
         TabIndex        =   9
         Top             =   1380
         Width           =   495
      End
   End
   Begin VB.PictureBox Picture1 
      Height          =   720
      Left            =   0
      Picture         =   "frmTel.frx":0000
      ScaleHeight     =   660
      ScaleWidth      =   4875
      TabIndex        =   0
      Top             =   0
      Width           =   4935
   End
   Begin CSCommand.Command cmdIn 
      Default         =   -1  'True
      Height          =   225
      Left            =   960
      TabIndex        =   1
      Top             =   2730
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   397
      IconAlign       =   0
      Icon            =   "frmTel.frx":61C3
      Caption         =   "入 帐"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin CSCommand.Command cmdBack 
      Cancel          =   -1  'True
      Height          =   225
      Left            =   2640
      TabIndex        =   13
      Top             =   2730
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   397
      IconAlign       =   0
      Icon            =   "frmTel.frx":61DF
      Caption         =   "返 回"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmTel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim TelCon As New ADODB.Connection         '打开话费表所用
Dim Telrs As New ADODB.Recordset
Dim TelStr As String

Dim con As New ADODB.Connection        '打开顾客表所用
Dim rs As New ADODB.Recordset
Dim ConStr As String
Private Sub cmdBack_Click()
    Unload Me
End Sub
Private Sub cmdIn_Click()
    If txtRoomId.Text = "" Then                                     '房间号约束
        MsgBox "没有输入房间号码!", vbInformation + vbOKOnly, "话费"
        txtRoomId.SetFocus
        Exit Sub
    End If
    
    If txtName.Text = "" Then                                       '姓名约束
        MsgBox "没有输入顾客姓名!", vbInformation + vbOKOnly, "话费"
        Exit Sub
        txtRoomId.SetFocus
    End If
    
    If txtPrice.Text = "" Then                                      '金额约束
        MsgBox "没有金额输入!", vbInformation + vbOKOnly, "话费"
        txtPrice.SetFocus
        Exit Sub
    End If
        
    TelStr = "select * from telprice"
    If mdlCon.connectTotable(TelCon, Telrs, TelStr) Then
    End If
        Telrs.AddNew
        Telrs!tel_roomid = txtRoomId.Text
        Telrs!tel_name = txtName.Text
        Telrs!tel_price = txtPrice.Text
        Telrs!tel_date = DTPicker1.Value
        Telrs!tel_conid = txtconid.Text
        Telrs!tel_remark = Text4.Text
        Telrs.Update
        MsgBox "话费入帐成功,本窗体关闭!"
        Unload Me
        Telrs.Close
        TelCon.Close
End Sub

Private Sub Form_Activate()
    txtRoomId.SetFocus
End Sub

Private Sub Form_Load()
    DTPicker1.Value = Date
End Sub

Private Sub txtName_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ConStr = "select * from roomuse where use_roomid='" & txtRoomId.Text & "'and use_state='在住'"
    If mdlCon.connectTotable(con, rs, ConStr) Then
        txtName.Text = rs!use_name
        txtconid.Text = rs!use_id
    Else
        MsgBox "此房间没有无人入住", vbInformation + vbOKOnly, "话费入帐"
        txtRoomId.Text = ""
        txtRoomId.SetFocus
    End If
    rs.Close
    con.Close
    
End Sub

Private Sub txtPrice_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 45, 46, vbKey0 To vbKey9, vbKeyBack
        Case Else
            KeyAscii = 0
        MsgBox "只能输入4位金额"
    End Select
End Sub

Private Sub txtRoomid_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 45, 46, vbKey0 To vbKey9, vbKeyBack
        Case Else
            KeyAscii = 0
        MsgBox "只能输入4位房间号码啊!"
    End Select
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -