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

📄 main.frm

📁 会员消费积分管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form MainForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "卡路.约翰 会员管理系统-用户列表"
   ClientHeight    =   3015
   ClientLeft      =   150
   ClientTop       =   150
   ClientWidth     =   10695
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   3015
   ScaleWidth      =   10695
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton reportcomm 
      Caption         =   "报表"
      Enabled         =   0   'False
      Height          =   495
      Left            =   8880
      TabIndex        =   26
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton refurbish_comm 
      Caption         =   "刷新"
      Enabled         =   0   'False
      Height          =   495
      Left            =   5880
      TabIndex        =   25
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton AddConsume_comm 
      Caption         =   "消费登记"
      Enabled         =   0   'False
      Height          =   495
      Left            =   7320
      TabIndex        =   24
      Top             =   2400
      Width           =   1335
   End
   Begin VB.TextBox Text9 
      Height          =   375
      Left            =   9120
      TabIndex        =   19
      Text            =   "0"
      Top             =   600
      Width           =   1215
   End
   Begin VB.TextBox Text8 
      Height          =   375
      Left            =   5160
      TabIndex        =   17
      Text            =   "0"
      Top             =   1200
      Width           =   3375
   End
   Begin VB.TextBox Text7 
      Height          =   375
      Left            =   6840
      TabIndex        =   15
      Text            =   "0"
      Top             =   600
      Width           =   1335
   End
   Begin VB.TextBox Text6 
      Height          =   375
      Left            =   4440
      TabIndex        =   12
      Text            =   "0"
      Top             =   600
      Width           =   1575
   End
   Begin VB.CommandButton Command7 
      Caption         =   ">>"
      Enabled         =   0   'False
      Height          =   495
      Left            =   4080
      TabIndex        =   11
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton Command6 
      Caption         =   "<<"
      Enabled         =   0   'False
      Height          =   495
      Left            =   120
      TabIndex        =   10
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton Command5 
      Caption         =   "<"
      Enabled         =   0   'False
      Height          =   495
      Left            =   1440
      TabIndex        =   9
      Top             =   2400
      Width           =   1215
   End
   Begin VB.CommandButton Command4 
      Caption         =   ">"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2760
      TabIndex        =   8
      Top             =   2400
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Height          =   375
      Left            =   840
      TabIndex        =   6
      Text            =   "0"
      Top             =   1200
      Width           =   3375
   End
   Begin VB.TextBox Text4 
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   600
      Width           =   735
   End
   Begin VB.TextBox Text3 
      Height          =   375
      Left            =   840
      TabIndex        =   2
      Top             =   600
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "用户列表"
      Enabled         =   0   'False
      Height          =   495
      Left            =   1440
      TabIndex        =   1
      Top             =   0
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "连接"
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   1215
   End
   Begin VB.Label Label11 
      Caption         =   "记录数:"
      Height          =   375
      Left            =   120
      TabIndex        =   23
      Top             =   1800
      Width           =   735
   End
   Begin VB.Label Label10 
      Caption         =   "当前记录:"
      Height          =   375
      Left            =   2160
      TabIndex        =   22
      Top             =   1800
      Width           =   975
   End
   Begin VB.Label Label9 
      Height          =   375
      Left            =   3240
      TabIndex        =   21
      Top             =   1800
      Width           =   1815
   End
   Begin VB.Label Label8 
      Height          =   375
      Left            =   960
      TabIndex        =   20
      Top             =   1800
      Width           =   975
   End
   Begin VB.Label Label7 
      Caption         =   "最后消费:"
      Height          =   375
      Left            =   8280
      TabIndex        =   18
      Top             =   600
      Width           =   855
   End
   Begin VB.Label Label6 
      Caption         =   "卡号:"
      Height          =   375
      Left            =   120
      TabIndex        =   16
      Top             =   1200
      Width           =   975
   End
   Begin VB.Label Label5 
      Caption         =   "总消费:"
      Height          =   375
      Left            =   6120
      TabIndex        =   14
      Top             =   600
      Width           =   975
   End
   Begin VB.Label Label4 
      Caption         =   "电话:"
      Height          =   375
      Left            =   3840
      TabIndex        =   13
      Top             =   600
      Width           =   615
   End
   Begin VB.Label Label3 
      Caption         =   "身份证:"
      Height          =   375
      Left            =   4320
      TabIndex        =   7
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "姓别:"
      Height          =   255
      Left            =   2400
      TabIndex        =   5
      Top             =   600
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "会员:"
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Top             =   600
      Width           =   495
   End
End
Attribute VB_Name = "MainForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Public ocn As New Class1
Public rs As New Class1
Dim userid As Integer


Private Sub AddConsume_Comm_Click()
Add_Consume_Form.Show
Add_Consume_Form.Text1.Text = rs.rs("cardno")

End Sub

Private Sub AddMember_comm_Click()
Unload Me
AddMemberFr.Show
End Sub




Private Sub Command2_Click()
If ocn.ocn.State = False Then
ocn.ocn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=DATA.mdb;Persist security info=false"
ocn.ocn.Open
End If
Command3.Enabled = True
End Sub

Private Sub Command3_Click()
If rs.rs.State = False Then
    rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
    Else
    rs.rs.Close
    rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
End If
rs.rs.Requery
If Not rs.rs.BOF And Not rs.rs.EOF Then
    Text3.Text = rs.rs("username")
    Text4.Text = rs.rs("sex")
    Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
    Text6.Text = rs.rs("tel")
    Text7.Text = rs.rs("allxf")
    Text8.Text = rs.rs("usercode")
    Text9.Text = rs.rs("lastxf")
    userid = rs.rs("id")
    Label8.Caption = rs.rs.RecordCount
    Label9.Caption = rs.rs.AbsolutePosition
    Command4.Enabled = True
    Command5.Enabled = True
    Command6.Enabled = True
    Command7.Enabled = True
    refurbish_comm.Enabled = True
    reportcomm.Enabled = True
    
    If frmLogin.Popedom = 1 Then
        AddConsume_Comm.Enabled = True
        
    End If
    
    
End If



End Sub

Private Sub Command4_Click()
If Not rs.rs.EOF Then
rs.rs.MoveNext
If Not rs.rs.EOF Then
Text3.Text = rs.rs("username")
Text4.Text = rs.rs("sex")
Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
Text6.Text = rs.rs("tel")
Text7.Text = rs.rs("allxf")
Text8.Text = rs.rs("usercode")
Text9.Text = rs.rs("lastxf")
userid = rs.rs("id")
Label9.Caption = rs.rs.AbsolutePosition
End If
End If

End Sub

Private Sub Command5_Click()
If Not rs.rs.BOF Then
rs.rs.MovePrevious
If Not rs.rs.BOF Then
Text3.Text = rs.rs("username")
Text4.Text = rs.rs("sex")
Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
Text6.Text = rs.rs("tel")
Text7.Text = rs.rs("allxf")
Text8.Text = rs.rs("usercode")
Text9.Text = rs.rs("lastxf")
userid = rs.rs("id")
Label9.Caption = rs.rs.AbsolutePosition

End If
End If

End Sub

Private Sub Command6_Click()
If rs.rs.BOF = False Then
rs.rs.MoveFirst
If Not rs.rs.BOF Then
Text3.Text = rs.rs("username")
Text4.Text = rs.rs("sex")
Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
Text6.Text = rs.rs("tel")
Text7.Text = rs.rs("allxf")
Text8.Text = rs.rs("usercode")
Text9.Text = rs.rs("lastxf")
userid = rs.rs("id")
Label9.Caption = rs.rs.AbsolutePosition
End If
End If

End Sub

Private Sub Command7_Click()
If rs.rs.BOF = False Then
rs.rs.MoveLast
If Not rs.rs.EOF Then
Text3.Text = rs.rs("username")
Text4.Text = rs.rs("sex")
Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
Text6.Text = rs.rs("tel")
Text7.Text = rs.rs("allxf")
Text8.Text = rs.rs("usercode")
Text9.Text = rs.rs("lastxf")
userid = rs.rs("id")
Label9.Caption = rs.rs.AbsolutePosition

End If
End If
End Sub

Private Sub consume_menu_Click()
Consume_list.Show

End Sub


'Private Sub Form_Load()
'If ocn.ocn.State = False Then
'ocn.ocn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=DATA.mdb;Persist security info=false"
'ocn.ocn.Open
'End If
'If rs.rs.State = False Then
'rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
'Else
'rs.rs.Requery
'Label8.Caption = rs.rs.RecordCount
'Label9.Caption = rs.rs.AbsolutePosition

'End If

'Command3.Enabled = True

'End Sub

Private Sub Form_Unload(Cancel As Integer)
If ocn.ocn.State = True Then
ocn.ocn.Close
Set ocn.ocn = Nothing
End If
If rs.rs.State = True Then
rs.rs.Close
Set rs.rs = Nothing
End If
End Sub

Private Sub refurbish_comm_Click()
'If rs.rs.State = True Then
'rs.rs.Requery
'Text3.Text = rs.rs("username")
'Text4.Text = rs.rs("sex")
'Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
'Text6.Text = rs.rs("tel")
'Text7.Text = rs.rs("allxf")
'Text8.Text = rs.rs("usercode")
'Text9.Text = rs.rs("lastxf")
'Label8.Caption = rs.rs.RecordCount
'Command4.Enabled = True
'Command5.Enabled = True
'Command6.Enabled = True
'Command7.Enabled = True
'Label9.Caption = rs.rs.AbsolutePosition


'End If
If rs.rs.State = False Then
    rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
    Else
    rs.rs.Close
    rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
    
End If
rs.rs.Requery
If Not rs.rs.BOF And Not rs.rs.EOF Then
    Text3.Text = rs.rs("username")
    Text4.Text = rs.rs("sex")
    Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
    Text6.Text = rs.rs("tel")
    Text7.Text = rs.rs("allxf")
    Text8.Text = rs.rs("usercode")
    Text9.Text = rs.rs("lastxf")
    Label8.Caption = rs.rs.RecordCount
    Label9.Caption = rs.rs.AbsolutePosition
    Command4.Enabled = True
    Command5.Enabled = True
    Command6.Enabled = True
    Command7.Enabled = True
    
    If frmLogin.Popedom = 1 Then
        AddConsume_Comm.Enabled = True
        
    End If
    
    
End If

End Sub

Private Sub Search_Comm_Click()

'Unload Me
consume.Show


End Sub

Private Sub Search_member_comm_Click()
Dim search_member_str As String
search_member_str = InputBox("please input keyword to find member")
If search_member_str <> "" Then
If rs.rs.State = False Then

rs.rs.Open "select*from userlist where username='" & search_member_str & "'", ocn.ocn, 1, 1
Else
rs.rs.Close
Set rs.rs = Nothing
rs.rs.Open "select*from userlist where username='" & search_member_str & "'", ocn.ocn, 1, 1
End If
If rs.rs.EOF = False Then
Text3.Text = rs.rs("username")
Text4.Text = rs.rs("sex")
Text5.Text = rs.rs("cardno") & "(" & rs.rs("cardtype") & ")"
Text6.Text = rs.rs("tel")
Text7.Text = rs.rs("allxf")
Text8.Text = rs.rs("usercode")
Text9.Text = rs.rs("lastxf")
Label8.Caption = rs.rs.RecordCount
Label8.Caption = rs.rs.AbsolutePosition
Command4.Enabled = True
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Else
Label9.Caption = "no data"
rs.rs.Close
rs.rs.Open "select*from userlist", ocn.ocn, 1, 1
End If
End If

End Sub

Private Sub reportcomm_Click()
      Dim strSQL As String
      If DataEnv.rsrtpcommand.State = 1 Then
      DataEnv.rsrtpcommand.Close
      End If
      
      strSQL = "select * from userlist where id =" & userid
     
      
      DataEnv.rsrtpcommand.Open strSQL
      '      DataEnv.rsrptStudent.Open strSQL
      DataReport1.Show

End Sub

⌨️ 快捷键说明

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