📄 frmgivestopwaterquery_select.frm
字号:
VERSION 5.00
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form frmGiveStopWaterQuery_Select
BorderStyle = 1 'Fixed Single
Caption = "停送水记录选择"
ClientHeight = 1815
ClientLeft = 45
ClientTop = 330
ClientWidth = 4605
Icon = "frmGiveStopWaterQuery_Select.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1815
ScaleWidth = 4605
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
Height = 915
Left = 210
TabIndex = 3
Top = 60
Width = 4230
Begin VB.ComboBox cboMonth
Height = 300
Left = 1545
Style = 2 'Dropdown List
TabIndex = 2
Top = 345
Width = 720
End
Begin MSMask.MaskEdBox txtYear
Height = 300
Left = 300
TabIndex = 1
Top = 345
Width = 915
_ExtentX = 1614
_ExtentY = 529
_Version = 393216
MaxLength = 4
Mask = "9999"
PromptChar = " "
End
Begin VB.Label Label2
Caption = "年"
Height = 210
Left = 1260
TabIndex = 5
Top = 405
Width = 225
End
Begin VB.Label Label1
Caption = "月份"
Height = 210
Left = 2280
TabIndex = 4
Top = 420
Width = 480
End
End
Begin VB.CommandButton cmdCB
Caption = "确定"
Height = 405
Index = 0
Left = 225
TabIndex = 0
Top = 1245
Width = 1065
End
Begin VB.Line Line1
BorderColor = &H80000003&
Index = 1
X1 = 75
X2 = 4530
Y1 = 1065
Y2 = 1065
End
Begin VB.Line Line1
BorderColor = &H80000005&
Index = 0
X1 = 75
X2 = 4530
Y1 = 1080
Y2 = 1080
End
End
Attribute VB_Name = "frmGiveStopWaterQuery_Select"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public strReturnSQL As String
Public strReturnYear As String
Public strReturnMonth As String
Private Sub cmdCB_Click(Index As Integer)
'将选择的信息返回到调用窗口并显示出来
strReturnSQL = "SELECT SwID, StartDate, StartTime, EndDate, EndTime, Area, Cause," & _
"ntf1 = CASE notify1 WHEN '0' THEN '' WHEN '1' THEN '有' END," & _
"ntf2 = CASE notify2 WHEN '0' THEN '' WHEN '1' THEN '有' END," & _
"ntf3 = CASE notify3 WHEN '0' THEN '' WHEN '1' THEN '有' END," & _
"ntf4 = CASE notify4 WHEN '0' THEN '' WHEN '1' THEN '有' END," & _
"ntf5 = CASE notify5 WHEN '0' THEN '' WHEN '1' THEN '有' END " & _
"From StopWater " & _
"WHERE year(StartDate)='" & Str(Me.txtYear.Text) & "' and month(StartDate)='" & Str(Me.cboMonth.ListIndex + 1) & "'"
strReturnYear = Me.txtYear.Text
strReturnMonth = Me.cboMonth.Text
Unload Me
End Sub
Private Sub Form_Load()
txtYear.Text = Year(Date)
cboMonth.AddItem ("01")
cboMonth.AddItem ("02")
cboMonth.AddItem ("03")
cboMonth.AddItem ("04")
cboMonth.AddItem ("05")
cboMonth.AddItem ("06")
cboMonth.AddItem ("07")
cboMonth.AddItem ("08")
cboMonth.AddItem ("09")
cboMonth.AddItem ("10")
cboMonth.AddItem ("11")
cboMonth.AddItem ("12")
cboMonth.ListIndex = Month(Date) - 1
strReturnSQL = ""
strReturnYear = Str(Year(Date))
strReturnMonth = Trim(Str(Month(Date)))
strReturnMonth = String(2 - Len(strReturnMonth), "0") & strReturnMonth
End Sub
Private Sub txtYear_GotFocus()
Call AutoSelectText(txtYear)
End Sub
Private Sub txtYear_KeyPress(KeyAscii As Integer)
Call IfEnterKeyMoveNext(KeyAscii)
End Sub
Private Sub txtYear_LostFocus()
If txtYear.Text < 1000 Or txtYear.Text > 9999 Then
Warning "格式输入错误!!!"
txtYear.SetFocus
Exit Sub
End If
End Sub
Private Sub cboMonth_KeyPress(KeyAscii As Integer)
Call IfEnterKeyMoveNext(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -