📄 form8obscure.frm
字号:
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1485
TabIndex = 24
Top = 2460
Width = 255
End
Begin VB.Label Label6
Caption = "日"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 23
Top = 2460
Width = 255
End
Begin VB.Label Label7
Caption = "日"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 16
Top = 1380
Width = 255
End
Begin VB.Label Label5
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1485
TabIndex = 13
Top = 1380
Width = 255
End
Begin VB.Label Label1
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 765
TabIndex = 10
Top = 1380
Width = 255
End
Begin VB.Label Label4
Caption = "初装日期:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 7
Top = 2040
Width = 1095
End
Begin VB.Label Label2
Caption = "姓名:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 6
Top = 165
Width = 615
End
Begin VB.Label Label3
Caption = "交费日期:"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 5
Top = 840
Width = 1095
End
Begin VB.Line Line1
BorderColor = &H8000000C&
BorderStyle = 6 'Inside Solid
X1 = 0
X2 = 2280
Y1 = 600
Y2 = 600
End
Begin VB.Line Line2
BorderColor = &H8000000C&
X1 = 0
X2 = 2280
Y1 = 1800
Y2 = 1800
End
Begin VB.Line Line3
BorderColor = &H8000000C&
X1 = 0
X2 = 2280
Y1 = 2880
Y2 = 2880
End
Begin VB.Line Line4
BorderColor = &H80000011&
BorderStyle = 6 'Inside Solid
X1 = 0
X2 = 2280
Y1 = 3960
Y2 = 3960
End
End
Attribute VB_Name = "Form8obscure"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim entrydate As Date
Dim lstring As String
Dim czd As String
Dim czx As String
Dim jfd As String
Dim jfx As String
Dim xm As String
Dim cancelif As Boolean
Dim dz As String
Dim stczd As String
Dim stjfd As String
Dim stxm As String
Dim stdz As String
Private Sub command1_Click()
If czd = "" Then
hzzde.Commands("obscure").Parameters(0).Value = "1980-01-01"
Else
hzzde.Commands("obscure").Parameters(0).Value = czd
End If
If czx = "" Then
hzzde.Commands("obscure").Parameters(1).Value = "2010-01-01"
Else
hzzde.Commands("obscure").Parameters(1).Value = czx
End If
If jfd = "" Then
hzzde.Commands("obscure").Parameters(2).Value = "2000-01-01"
Else
hzzde.Commands("obscure").Parameters(2).Value = jfd
End If
If jfx = "" Then
hzzde.Commands("obscure").Parameters(3).Value = "2010-01-01"
Else
hzzde.Commands("obscure").Parameters(3).Value = jfx
End If
If xm = "" Then
hzzde.Commands("obscure").Parameters(4).Value = "%"
Else
hzzde.Commands("obscure").Parameters(4).Value = xm
End If
If dz = "" Then
hzzde.Commands("obscure").Parameters(5).Value = "%"
Else
hzzde.Commands("obscure").Parameters(5).Value = dz
End If
hzzde.Commands("obscure").Execute
If hzzde.rsobscure.State <> adStateOpen Then
hzzde.rsobscure.Open
End If
hzzde.rsobscure.Requery '使记录集重新定位
If hzzde.rsobscure.RecordCount = 0 Then
MSHFlexGrid1.Clear
MsgBox "符合此条件的记录不存在,请重新选择", vbOKOnly, "警示"
command2.Enabled = True
Exit Sub
Else
Set MSHFlexGrid1.DataSource = hzzde
MSHFlexGrid1.DataMember = "obscure"
MSHFlexGrid1.Refresh
MSHFlexGrid1.Redraw = True
End If
cancelif = False
command2.Enabled = True
End Sub
Private Sub Command2_Click() '取消
cancelif = True
xm = "": dz = "": czd = "": czx = "": jfd = "": jfx = ""
MSHFlexGrid1.Clear
stczd = "": stjfd = "": stxm = "": stdz = ""
StatusBar1.SimpleText = ""
Text1.Text = "": Text2.Text = "2000"
Text3.Text = "": Text4.Text = "": Text5.Text = "": Text6.Text = "": Text7.Text = "2000"
DataCombo1.Text = ""
MSHFlexGrid1.SetFocus
command2.Enabled = False
command1.Enabled = False
cancelif = False
End Sub
Private Sub DataCombo1_Click(Area As Integer)
If Area = 2 Then
dz = Trim(DataCombo1.Text) + "%"
stdz = " 地址 " + DataCombo1.Text
lstring = stxm + stdz + stczd + stjfd
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
MSHFlexGrid1.SetFocus
End If
End Sub
Private Sub Form_Load()
entrydate = Now()
xm = ""
command1.Enabled = False
command2.Enabled = False
stczd = "": stjfd = "": stxm = "": stdz = ""
MSHFlexGrid1.ColWidth(0, 0) = 300
MSHFlexGrid1.ColWidth(1, 0) = 700
MSHFlexGrid1.ColWidth(2, 0) = 900
MSHFlexGrid1.ColWidth(3, 0) = 700
MSHFlexGrid1.ColWidth(4, 0) = 700
MSHFlexGrid1.ColWidth(5, 0) = 900
MSHFlexGrid1.ColWidth(6, 0) = 700
MSHFlexGrid1.ColWidth(7, 0) = 900
MSHFlexGrid1.ColWidth(8, 0) = 700
MSHFlexGrid1.ColWidth(9, 0) = 1400
MSHFlexGrid1.ColWidth(10, 0) = 1500
MSHFlexGrid1.MergeCol(1) = True
MSHFlexGrid1.MergeCol(2) = True
MSHFlexGrid1.MergeCol(3) = True
MSHFlexGrid1.MergeCol(4) = True
MSHFlexGrid1.MergeCol(5) = True
MSHFlexGrid1.MergeCol(6) = True
MSHFlexGrid1.MergeCol(7) = True
MSHFlexGrid1.MergeCol(9) = True
MSHFlexGrid1.MergeCol(8) = True
MSHFlexGrid1.MergeCol(10) = True
MSHFlexGrid1.BackColorFixed = vbCyan
MSHFlexGrid1.BackColorSel = vbGreen
MSHFlexGrid1.BackColor = vbGreen
MSHFlexGrid1.ScrollTrack = True
cancelif = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call history(staff, entrydate, Me.Caption, Now())
End Sub
Private Sub Text1_GotFocus()
Text1.IMEMode = 1
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Len(Text1.Text) < 4 Then ' 当输入小于四个字时
If KeyAscii = 13 Then '回车键
If Text1.Text = "" Then
MsgBox "姓名不得为空", vbOKOnly, "警示"
Text1.SetFocus
Exit Sub
Else
Text1.IMEMode = 2
MSHFlexGrid1.SetFocus
End If
End If
End If
If Len(Text1.Text) = 4 Then '当输入等于四个字时
If KeyAscii = 13 Then '回车键
Text1.IMEMode = 2
MSHFlexGrid1.SetFocus
Else
If KeyAscii <> 8 Then '回撤键
KeyAscii = 0
End If
End If
End If
If Len(Text1.Text) > 4 Then '当输入大于四个字时
KeyAscii = 0 '取消输入
End If
End Sub
Private Sub Text1_LostFocus()
If Text1.Text <> "" Then
xm = Trim(Text1.Text) + "%"
stxm = " 姓名 " + Text1.Text
lstring = stxm + stdz + stczd + stjfd
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
MSHFlexGrid1.SetFocus
Else
xm = "%"
stxm = ""
lstring = stxm + stdz + stczd + stjfd
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
MSHFlexGrid1.SetFocus
End If
Text1.IMEMode = 2
End Sub
Private Sub Text2_Change() '交费年
If Not cancelif Then
If (Val(Text2.Text) >= 2000 And Val(Text2.Text) <= 2010 And Len(Text2.Text) = 4) And (Text3.Text = "" Or Text3.Text = "0") And (Text4.Text = "" Or Text4.Text = "0") Then
jfd = Text2.Text + "-01-01"
jfx = Text2.Text + "-12-31"
stjfd = " 交费日期在" + Text2.Text + "年之内"
End If
If (Text3.Text = "1" Or Text3.Text = "2" Or Text3.Text = "3" Or Text3.Text = "4" Or Text3.Text = "5" Or _
Text3.Text = "6" Or Text3.Text = "7" Or Text3.Text = "8" Or Text3.Text = "9" Or Text3.Text = "10" Or _
Text3.Text = "11" Or Text3.Text = "12") _
And (Text4.Text = "" Or Text4.Text = "0") Then
jfd = Text2.Text + "-" + Text3.Text + "-01"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -