📄 form7comben.frm
字号:
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 10
Top = 1965
Width = 1095
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 = 0
TabIndex = 9
Top = 3240
Width = 855
End
End
Attribute VB_Name = "Form7combin"
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 Date
Dim czx As Date
Dim jfd As Date
Dim jfx As Date
Dim xm As String
Dim zzh As Boolean
Dim comflag As Boolean
Dim stczd As String
Dim stczx As String
Dim stjfd As String
Dim stjfx As String
Dim stxm As String
Dim stzzh As String
Private Sub command1_Click() '确定
If comflag Then
If czd = #11/11/1111# Then
hzzde.Commands("combin1").Parameters(0).Value = "1980-01-01"
Else
hzzde.Commands("combin1").Parameters(0).Value = czd
End If
If czx = #11/11/1111# Then
hzzde.Commands("combin1").Parameters(1).Value = "2010-01-01"
Else
hzzde.Commands("combin1").Parameters(1).Value = czx
End If
If jfd = #11/11/1111# Then
hzzde.Commands("combin1").Parameters(2).Value = "2000-01-01"
Else
hzzde.Commands("combin1").Parameters(2).Value = jfd
End If
If jfx = #11/11/1111# Then
hzzde.Commands("combin1").Parameters(3).Value = "2010-01-01"
Else
hzzde.Commands("combin1").Parameters(3).Value = jfx
End If
If xm = "" Then
hzzde.Commands("combin1").Parameters(4).Value = "%"
Else
hzzde.Commands("combin1").Parameters(4).Value = xm
End If
hzzde.Commands("combin1").Parameters(5).Value = zzh
hzzde.Commands("combin1").Execute
If hzzde.rscombin1.State <> adStateOpen Then
hzzde.rscombin1.Open
End If
hzzde.rscombin1.Requery '使记录集重新定位
If hzzde.rscombin1.RecordCount = 0 Then
MsgBox "符合此条件的记录不存在,请重新选择", vbOKOnly, "警示"
command2.Enabled = True
Exit Sub
Else
Set MSHFlexGrid1.DataSource = hzzde
MSHFlexGrid1.DataMember = "combin1"
MSHFlexGrid1.Refresh
MSHFlexGrid1.Redraw = True
End If
Else
If czd = #11/11/1111# Then
hzzde.Commands("combin2").Parameters(0).Value = "1980-01-01"
Else
hzzde.Commands("combin2").Parameters(0).Value = czd
End If
If czx = #11/11/1111# Then
hzzde.Commands("combin2").Parameters(1).Value = "2010-01-01"
Else
hzzde.Commands("combin2").Parameters(1).Value = czx
End If
If jfd = #11/11/1111# Then
hzzde.Commands("combin2").Parameters(2).Value = "2000-01-01"
Else
hzzde.Commands("combin2").Parameters(2).Value = jfd
End If
If jfx = #11/11/1111# Then
hzzde.Commands("combin2").Parameters(3).Value = "2010-01-01"
Else
hzzde.Commands("combin2").Parameters(3).Value = jfx
End If
If xm = "" Then
hzzde.Commands("combin2").Parameters(4).Value = "%"
Else
hzzde.Commands("combin2").Parameters(4).Value = xm
End If
hzzde.Commands("combin2").Execute
If hzzde.rscombin2.State <> adStateOpen Then
hzzde.rscombin2.Open
End If
hzzde.rscombin2.Requery '使记录集重新定位
If hzzde.rscombin2.RecordCount = 0 Then
MsgBox "符合此条件的记录不存在,请重新选择", vbOKOnly, "警示"
command2.Enabled = True
Exit Sub
Else
Set MSHFlexGrid1.DataSource = hzzde
MSHFlexGrid1.DataMember = "combin2"
MSHFlexGrid1.Refresh
End If
End If
command1.Enabled = False
command2.Enabled = True
MSHFlexGrid1.SetFocus
comflag = False
End Sub
Private Sub Command2_Click()
czd = #11/11/1111#
czx = #11/11/1111#
jfd = #11/11/1111#
jfx = #11/11/1111#
xm = ""
MSHFlexGrid1.Clear
Text1.Text = ""
DTPicker1.Value = Year(Now) & "-01-01"
DTPicker2.Value = Year(Now) & "-01-01"
DTPicker3.Value = Year(Now) & "-01-01"
DTPicker4.Value = Year(Now) & "-01-01"
comflag = False
stczd = "": stczx = "": stjfd = "": stjfx = "": stxm = "": stzzh = ""
StatusBar1.SimpleText = ""
MSHFlexGrid1.SetFocus
command2.Enabled = False
command1.Enabled = False
End Sub
Private Sub DTPicker1_Change()
jfd = DTPicker1.Value
End Sub
Private Sub DTPicker1_CloseUp()
stjfd = " 交费日期在" & jfd & "之后"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
command1.SetFocus
End Sub
Private Sub DTPicker2_Change()
czd = DTPicker2.Value
End Sub
Private Sub DTPicker2_CloseUp()
stczd = " 初装日期在" & czd & "之后"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
command1.SetFocus
End Sub
Private Sub DTPicker3_Change()
jfx = DTPicker3.Value
End Sub
Private Sub DTPicker3_CloseUp()
stjfx = " 交费日期在" & jfx & "之前"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
command1.SetFocus
End Sub
Private Sub DTPicker4_Change()
czx = DTPicker4.Value
End Sub
Private Sub DTPicker4_CloseUp()
stczx = " 初装日期在" & czx & "之前"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
command1.SetFocus
End Sub
Private Sub Form_Load()
entrydate = Now()
DTPicker1.Value = Year(Now) & "-01-01"
DTPicker2.Value = Year(Now) & "-01-01"
DTPicker3.Value = Year(Now) & "-01-01"
DTPicker4.Value = Year(Now) & "-01-01"
command1.Enabled = False
command2.Enabled = False
comflag = False
czd = #11/11/1111#
czx = #11/11/1111#
jfd = #11/11/1111#
jfx = #11/11/1111#
xm = ""
stczd = "": stczx = "": stjfd = "": stjfx = "": stxm = "": stzzh = ""
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
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Call history(staff, entrydate, Me.Caption, Now())
End Sub
Private Sub Option1_Click()
comflag = True
zzh = True
command1.Enabled = True
command1.SetFocus
stzzh = " 有增装盒"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
End Sub
Private Sub Option2_Click()
comflag = True
zzh = False
command1.Enabled = True
command1.SetFocus
stzzh = " 无增装盒"
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
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()
xm = Trim(Text1.Text) + "%"
stxm = " 姓名 " + Text1.Text
lstring = stxm + stzzh + stczd + stczx + stjfd + stjfx
StatusBar1.SimpleText = "查询条件为:" + lstring
command1.Enabled = True
MSHFlexGrid1.SetFocus
Text1.IMEMode = 2
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -