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

📄 persons.frm

📁 现金系统: 有直销奖金发放等功能
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form persons 
   ClientHeight    =   3675
   ClientLeft      =   4860
   ClientTop       =   3930
   ClientWidth     =   9315
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3675
   ScaleWidth      =   9315
   Begin VB.TextBox Acashtype 
      Height          =   270
      Left            =   7560
      TabIndex        =   13
      Top             =   1800
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.TextBox Acashname 
      Height          =   270
      Left            =   7680
      TabIndex        =   12
      Top             =   2415
      Width           =   1095
   End
   Begin VB.CommandButton exhh 
      Caption         =   "exit"
      Height          =   375
      Left            =   7920
      TabIndex        =   11
      Top             =   1080
      Width           =   855
   End
   Begin VB.CommandButton okModify 
      Caption         =   "ok Modify"
      Height          =   375
      Left            =   6480
      TabIndex        =   10
      Top             =   1080
      Width           =   975
   End
   Begin MSFlexGridLib.MSFlexGrid MSFGType 
      Height          =   2295
      Left            =   2880
      TabIndex        =   9
      Top             =   1200
      Width           =   3255
      _ExtentX        =   5741
      _ExtentY        =   4048
      _Version        =   393216
      Redraw          =   -1  'True
      SelectionMode   =   1
      FormatString    =   ""
   End
   Begin VB.CommandButton ex 
      Caption         =   "exit"
      Height          =   255
      Left            =   1560
      TabIndex        =   6
      Top             =   3240
      Width           =   975
   End
   Begin VB.CommandButton savenew 
      Caption         =   "Save"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      Top             =   3240
      Width           =   975
   End
   Begin VB.TextBox CASHNAME 
      Height          =   270
      Left            =   1440
      TabIndex        =   4
      Top             =   2280
      Width           =   1095
   End
   Begin VB.TextBox CASHTYPE 
      Height          =   270
      Left            =   1320
      TabIndex        =   2
      Top             =   1665
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.Label Label10 
      Caption         =   "No:"
      Height          =   255
      Left            =   6480
      TabIndex        =   15
      Top             =   1815
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Label Label9 
      Caption         =   "Name:"
      Height          =   255
      Left            =   6360
      TabIndex        =   14
      Top             =   2415
      Width           =   615
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      Caption         =   "Operation"
      Height          =   375
      Left            =   6960
      TabIndex        =   8
      Top             =   360
      Width           =   2175
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      Caption         =   "employees list"
      Height          =   255
      Left            =   3000
      TabIndex        =   7
      Top             =   360
      Width           =   2895
   End
   Begin VB.Label Label3 
      Caption         =   "Name:"
      Height          =   255
      Left            =   120
      TabIndex        =   3
      Top             =   2280
      Width           =   615
   End
   Begin VB.Label Label2 
      Caption         =   "No:"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   1680
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Label Label1 
      Caption         =   "initial employees"
      Height          =   255
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   1575
   End
End
Attribute VB_Name = "persons"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub ex_Click()
Unload Me
End Sub

Private Sub exhh_Click()
Unload Me
End Sub

Private Sub Form_Load()
MSFGType.FormatString = " NO |        Employee NAME   "

CASHNAME.Text = ""
Acashname.Text = ""
Acashname.Enabled = False
Dim inttype As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = DAO.OpenDatabase(App.Path + "\cashsys.mdb") ', False , False , " ; pwd=1234")
Set rs = db.OpenRecordset("select max(cashtype) as type from cashtype")
If IsNull(rs("type")) Then
 inttype = 1
Else
inttype = rs("type") + 1
End If
Cashtype.Text = inttype

Call fillgrid
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
okModify.Enabled = False
End Sub

Private Sub MSFGType_Click()
MSFGType.Col = 0
 Acashtype.Text = MSFGType.Text
 MSFGType.Col = 1

    Acashname.Text = MSFGType.Text
 Acashname.Enabled = True
    okModify.Enabled = True
    Acashname.SetFocus
End Sub
Private Sub fillgrid()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = DAO.OpenDatabase(App.Path + "\cashsys.mdb")
Set rs = db.OpenRecordset("SELECT PERsons.personNo , PERsons.personname FROM PERsons ")
MSFGType.FormatString = " NO |        Employee NAME   "
MSFGType.Rows = 1
Do While Not rs.EOF
  MSFGType.Rows = MSFGType.Rows + 1
    MSFGType.Row = MSFGType.Rows - 1
   MSFGType.Col = 0
   MSFGType.Text = Str(rs("personNo"))
   MSFGType.Col = 1
    MSFGType.Text = rs("personname")
  
    rs.MoveNext
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub

Private Sub okModify_Click()
On Error GoTo Err_modify_Click

Dim db As DAO.Database
Dim rs As DAO.Recordset

If Trim(Acashname.Text) = "" Then
   MsgBox "pls select"
   Acashname.SetFocus
   Exit Sub
End If
Set db = DAO.OpenDatabase(App.Path + "\cashsys.mdb")
Set rs = db.OpenRecordset("SELECT PERsons.personNo , PERsons.personname FROM PERsons where personNo=" + Acashtype)
rs.Edit
rs("personname") = Acashname.Text
rs.Update
Call fillgrid
Acashtype.Text = ""
Acashname.Text = ""
MsgBox "modify success!"
Acashname.Enabled = False
CASHNAME.SetFocus
okModify.Enabled = False

rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit_modify_Click:
    Exit Sub

Err_modify_Click:
    MsgBox Err.Description
    Resume Exit_modify_Click
    
End Sub

Private Sub savenew_Click()
On Error GoTo Err_SAVETYPE_Click

Dim db As DAO.Database
Dim rs As DAO.Recordset

If Trim(CASHNAME.Text) = "" Then
   MsgBox "pls Cash Name"
   CASHNAME.SetFocus
   Exit Sub
End If



Set db = DAO.OpenDatabase(App.Path + "\cashsys.mdb")
Set rs = db.OpenRecordset("SELECT PERsons.personNo , PERsons.personname FROM PERsons where personname='" + Trim(CASHNAME.Text) + "'")
If rs.EOF = False Then
CASHNAME.SetFocus
   MsgBox "repeat!"
   Exit Sub
End If

db.Execute "insert into PERsons (personNo,personname) values (" + Trim(Cashtype.Text) + ",'" + CASHNAME.Text + "')"

MSFGType.Clear

Call fillgrid

CASHNAME.Text = ""
Set rs = db.OpenRecordset("select max(cashtype) as type from cashtype")
Cashtype.Text = rs("type") + 1
CASHNAME.SetFocus

rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit_SAVETYPE_Click:
    Exit Sub

Err_SAVETYPE_Click:
    MsgBox Err.Description
    Resume Exit_SAVETYPE_Click
    
End Sub

⌨️ 快捷键说明

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