📄 frmylnh.frm
字号:
_ExtentX = 2355
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=LandaMis"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=LandaMis"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 水能耗表"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "FrmYLNH.frx":0038
Height = 1815
Left = -74880
TabIndex = 24
Top = 1680
Width = 7695
_ExtentX = 13573
_ExtentY = 3201
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 14
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.Label Label1
Caption = "单位:(升)"
ForeColor = &H000000FF&
Height = 255
Left = 4320
TabIndex = 15
Top = 960
Width = 1695
End
End
Begin VB.Label Label6
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 255
Left = 360
TabIndex = 3
Top = 5280
Width = 3495
End
Begin VB.Label Lable
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "油量能耗表"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 0
TabIndex = 2
Top = 240
Width = 8655
End
End
End
Attribute VB_Name = "FrmYLNH"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim PBH As Integer
Dim flag As Boolean
Private Sub Check1_Click()
If Check1.Value = 1 Then
Frame4.Visible = True
Else
Frame4.Visible = False
End If
End Sub
Private Sub BH_Change()
CMDSave.Enabled = True
End Sub
Private Sub cmdCancel_Click()
SBGCGL.Enabled = True
Unload Me
End Sub
Private Sub CMDDel_Click()
Result = MsgBox("您确实要删除吗?", vbYesNo)
If Result = 6 Then
SQL = "delete 油量能耗表 where 编号=" & PBH & ""
Set rs = ConnWZ.Execute(SQL)
PBH = 0
Else
Exit Sub
End If
End Sub
Private Sub cmdEdit_Click()
CMDSave.Enabled = True
flag = True
SL.Locked = False
JLR.Locked = False
End Sub
Private Sub CMDFresh_Click()
PBH = 0
SL = ""
RQ.Value = Date
JLR = ""
SL.Locked = False
JLR.Locked = False
CMDSave.Enabled = False
CMDDel.Enabled = False
cmdEdit.Enabled = False
flag = False
End Sub
Private Sub CMDSave_Click()
If flag = False Then
Result = MsgBox("您确实要保存吗?", vbYesNo)
If Result = 6 Then
SQL = "insert 油量能耗表(数量,日期,记录人) values (" & SL & ",'" & RQ & "','" & JLR & "')"
Set rs = ConnWZ.Execute(SQL)
End If
End If
If flag = True Then
Result = MsgBox("您确实要保存吗?", vbYesNo)
If Result = 6 Then
If SL = "" Then SL = 0
SQL = "update 油量能耗表 set 数量=" & SL & ",日期='" & RQ & "',记录人='" & JLR & "'where 序号=" & PBH & ""
Set Rsrkpd = ConnWZ.Execute(SQL)
CMDSave.Enabled = False
End If
End If
End Sub
Private Sub CMDSearch_Click()
If Check1.Value = 1 Then
Adodc1.RecordSource = "select * from 油量能耗表 where 日期 between '" & BeginDate.Value & "' and '" & EndDate.Value & "'"
Adodc1.Refresh
End If
End Sub
Private Sub DataGrid1_Click()
On Error Resume Next
SQL = "select * from 油量能耗表"
Set rs = ConnWZ.Execute(SQL)
If rs.EOF Then Exit Sub
PBH = Adodc1.Recordset.Fields("序号")
If Err = 13 Then
MsgBox "您进行了误操作,请重新进入该系统!"
End If
End Sub
Private Sub Form_Load()
On Error Resume Next
For Each TextBox In Me.Controls
TextBox.Font.Name = "宋体"
TextBox.Font.Size = 9
Next
PBH = 0
flag = False
'SJ.Value = Time$
'RQ.Value = Date
CMDSave.Enabled = False
cmdEdit.Enabled = False
CMDDel.Enabled = False
Label6.Caption = Now
'Combo1.Visible = False
'Frame8.Visible = False
End Sub
Private Sub SL_Change()
CMDSave.Enabled = True
If IsNumeric(SL) = False Then
MsgBox "请输入数字!"
SL = "0"
End If
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
flag = False
If PreviousTab = 0 Then
Check1.Value = 0
CMDSave.Enabled = False
cmdEdit.Enabled = False
CMDDel.Enabled = False
Adodc1.RecordSource = "select * from 油量能耗表 "
Adodc1.Refresh
End If
If PreviousTab = 1 Then
Frame4.Visible = False
' Frame8.Visible = False
' Combo1.Visible = False
If PBH <> 0 Then
SQL = "select * from 油量能耗表 where 序号=" & PBH & ""
Set rs = ConnWZ.Execute(SQL)
SL = rs("数量")
RQ = rs("日期")
JLR = rs("记录人")
SL.Locked = True
JLR.Locked = True
CMDSave.Enabled = False
cmdEdit.Enabled = True
CMDDel.Enabled = True
End If
End If
End Sub
Private Sub Timer1_Timer()
Label6.Caption = Now
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -