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

📄 frmfindmember.frm

📁 会员消费积分管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "会员名:"
      Height          =   495
      Left            =   2040
      TabIndex        =   1
      Top             =   600
      Width           =   1215
   End
End
Attribute VB_Name = "frmFindMember"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim findconn As New Class1
Dim findrs As New Class1
Dim userid As Integer
Dim InputType As Integer
Private Sub CancelComm_Click()
Unload Me
End Sub

Private Sub Combo1_Click()
Select Case Combo1.Text
    Case "会员名"
    InputType = 0
    Case "姓别"
    InputType = 0
    Case "卡号"
    InputType = 1
    Case "电话"
    InputType = 0
    Case "身份证"
    InputType = 0
    Case "总消费"
    InputType = 1
    Case "最后消费"
    InputType = 1

End Select
End Sub

Private Sub delComm_Click()
Dim isdel As Integer
If findconn.ocn.State = flase Then Exit Sub
If findrs.rs.State = flase Then Exit Sub

isdel = MsgBox("你真的要删除此用户?", vbYesNo)
If isdel = 6 Then
findconn.ocn.Execute "delete * from userlist where id=" & userid
FindComm_Click



End If

End Sub

Private Sub FindComm_Click()
Dim findstr As String, SQLstr As String, findKeyword As String, condition As String

Me.Caption = Combo1.Text & ":" & Combo2.Text
findstr = txtKeyword.Text
Select Case Combo1.Text
    Case "会员名"
    findKeyword = "username"
    Case "姓别"
    findKeyword = "sex"
    Case "卡号"
    findKeyword = "cardno"
    findstr = CInt(findstr)

    Case "电话"
    findKeyword = "tel"
    Case "身份证"
    findKeyword = "usercode"
    Case "总消费"
    findKeyword = "allxf"
    findstr = CLng(findstr)
    Case "最后消费"
    findKeyword = "lastxf"
    findstr = CLng(findstr)
    

End Select
Select Case Combo2.Text
    Case "准确查找"
    condition = "="
    SQLstr = "select*from userlist where " & findKeyword & "='" & findstr & "'"
    If IsNumeric(findstr) Then SQLstr = "select*from userlist where " & findKeyword & "=" & findstr
    
    Case "模糊查找"
    condition = "like"
    SQLstr = "select*from userlist where " & findKeyword & " " & "like" & "'%" & findstr & "%'"
    'If IsNumeric(findstr) Then SQLstr = "select*from userlist where " & findKeyword & "=" & findstr

End Select
If findconn.ocn.State = False Then
findconn.OpenData
End If
If findrs.rs.State = 1 Then
findrs.rs.Close
Set findrs.rs = Nothing
End If

findrs.rs.Open SQLstr, findconn.ocn, 1, 1
If findrs.rs.EOF Then
Label9.Caption = findrs.rs.RecordCount
ModifyComm.Enabled = False
delComm.Enabled = False
Exit Sub
End If
Label9.Caption = findrs.rs.RecordCount

Text1.Text = findrs.rs("username")
Text2.Text = findrs.rs("sex")
Text3.Text = findrs.rs("cardno")
Text4.Text = findrs.rs("tel")
Text5.Text = findrs.rs("usercode")
Text6.Text = findrs.rs("allxf")
Text7.Text = findrs.rs("lastxf")
Label12.Caption = findrs.rs.AbsolutePosition
userid = findrs.rs("id")
If frmLogin.Popedom = 1 Then
ModifyComm.Enabled = True
delComm.Enabled = True
End If

End Sub



Private Sub Form_Load()
If frmLogin.Popedom <> 1 Then
ModifyComm.Enabled = False
delComm.Enabled = False

End If
ModifyComm.Enabled = False
SaveModiComm.Enabled = False
delComm.Enabled = False


End Sub

Private Sub First_Comm_Click()
If findrs.rs.State = False Then Exit Sub
If findrs.rs.BOF Then Exit Sub
findrs.rs.MoveFirst
If findrs.rs.BOF Then Exit Sub
Text1.Text = findrs.rs("username")
Text2.Text = findrs.rs("sex")
Text3.Text = findrs.rs("cardno")
Text4.Text = findrs.rs("tel")
Text5.Text = findrs.rs("usercode")
Text6.Text = findrs.rs("allxf")
Text7.Text = findrs.rs("lastxf")
Label12.Caption = findrs.rs.AbsolutePosition
userid = findrs.rs("id")
frmFindMember.Caption = frmLogin.Popedom



End Sub



Private Sub Last_Comm_Click()
If findrs.rs.State = False Then Exit Sub
If findrs.rs.EOF Then Exit Sub
findrs.rs.MoveLast
If findrs.rs.EOF Then Exit Sub
Text1.Text = findrs.rs("username")
Text2.Text = findrs.rs("sex")
Text3.Text = findrs.rs("cardno")
Text4.Text = findrs.rs("tel")
Text5.Text = findrs.rs("usercode")
Text6.Text = findrs.rs("allxf")
Text7.Text = findrs.rs("lastxf")
Label12.Caption = findrs.rs.AbsolutePosition
userid = findrs.rs("id")

End Sub

Private Sub ModifyComm_Click()
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
SaveModiComm.Enabled = True
End Sub

Private Sub Next_Comm_Click()
If findrs.rs.State = False Then Exit Sub
If findrs.rs.EOF Then Exit Sub
findrs.rs.MoveNext
If findrs.rs.EOF Then Exit Sub
Text1.Text = findrs.rs("username")
Text2.Text = findrs.rs("sex")
Text3.Text = findrs.rs("cardno")
Text4.Text = findrs.rs("tel")
Text5.Text = findrs.rs("usercode")
Text6.Text = findrs.rs("allxf")
Text7.Text = findrs.rs("lastxf")
Label12.Caption = findrs.rs.AbsolutePosition
userid = findrs.rs("id")

End Sub

Private Sub pro_Comm_Click()
If findrs.rs.State = False Then Exit Sub
If findrs.rs.BOF Then Exit Sub
findrs.rs.MovePrevious

If findrs.rs.BOF Then Exit Sub
Text1.Text = findrs.rs("username")
Text2.Text = findrs.rs("sex")
Text3.Text = findrs.rs("cardno")
Text4.Text = findrs.rs("tel")
Text5.Text = findrs.rs("usercode")
Text6.Text = findrs.rs("allxf")
Text7.Text = findrs.rs("lastxf")
Label12.Caption = findrs.rs.AbsolutePosition
userid = findrs.rs("id")

End Sub

Private Sub report_comm_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

Private Sub SaveModiComm_Click()
Dim str As String
If findconn.ocn.State = flase Then Exit Sub
If findrs.rs.State = flase Then Exit Sub

str = "update userlist set username='" & Text1.Text & "',sex='" & Text2.Text & "',cardno='" & Text3.Text & "'," & _
"tel='" & Text4.Text & "',usercode='" & Text5.Text & "',allxf='" & Text6.Text & "',lastxf='" & Text7.Text & "'" & _
"where id=" & userid

findconn.ocn.Execute str

End Sub

Private Sub Text3_Change()
If IsNumeric(Text3.Text) = False Then
MsgBox "必需是数值型"
Text3.SetFocus
End If


End Sub

Private Sub Text5_Change()
If IsNumeric(Text5.Text) = False Then
MsgBox "必需是数值型"
Text5.SetFocus
End If

End Sub

Private Sub Text6_Change()
If IsNumeric(Text6.Text) = False Then
MsgBox "必需是数值型"
Text6.SetFocus
End If

End Sub

Private Sub Text7_Change()
If IsNumeric(Text7.Text) = False Then
MsgBox "必需是数值型"
Text7.SetFocus
End If

End Sub

Private Sub txtKeyword_Change()
If InputType = 1 Then
If IsNumeric(txtKeyword.Text) = False Then
MsgBox "必需是数字"
txtKeyword.SetFocus
End If
End If
End Sub

Private Sub txtKeyword_Click()
txtKeyword.SelStart = 0
txtKeyword.SelLength = Len(txtKeyword.Text)


End Sub

⌨️ 快捷键说明

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