?? frmwaterinfo.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmWaterInfo
Caption = "飲水機類型設置"
ClientHeight = 5970
ClientLeft = 60
ClientTop = 345
ClientWidth = 7785
LinkTopic = "Form1"
ScaleHeight = 5970
ScaleWidth = 7785
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 975
Left = 120
TabIndex = 2
Top = 4920
Width = 7575
Begin VB.CommandButton Command1
Caption = "添加"
Height = 375
Left = 480
TabIndex = 6
Top = 360
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "修改"
Height = 375
Left = 2205
TabIndex = 5
Top = 360
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "刪除"
Height = 375
Left = 3915
TabIndex = 4
Top = 360
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "返回"
Height = 375
Left = 5640
TabIndex = 3
Top = 360
Width = 1335
End
End
Begin VB.Frame Frame2
Caption = "飲水機瀏覽"
Height = 4455
Left = 120
TabIndex = 0
Top = 360
Width = 7575
Begin MSFlexGridLib.MSFlexGrid msgList
Height = 4095
Left = 120
TabIndex = 1
Top = 240
Width = 7335
_ExtentX = 12938
_ExtentY = 7223
_Version = 393216
AllowUserResizing= 1
End
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "飲水機類型瀏覽"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 255
Left = 2760
TabIndex = 7
Top = 120
Width = 2295
End
End
Attribute VB_Name = "frmWaterInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人為我,我為人人
'枕善居收藏整理
'發布日期:2006/12/06
'描 述: 純凈水進銷存管理系統 Ver 2.0
'網 站:http://www.Mndsoft.com/ (VB6源碼博客)
'網 站:http://www.VbDnet.com/ (VB.NET源碼博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
'****************************************************************************
Private Sub Command1_Click()
Load frmWater
frmWater.Show
End Sub
Private Sub Command2_Click()
Dim intCount As Integer
Dim txtsql As String
If msgList.Rows > 1 Then
'gintDHmode = 2
intCount = msgList.Row
If intCount > 0 Then
txtsql = "select * from 飲水機 where 飲水機編號 ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
wmEdit = 1
Load frmWater
frmWater.showdata (txtsql)
frmWater.Show 1, frmWaterInfo
Else
MsgBox "警告", vbOKOnly + vbExclamation, "請首先選擇需要修改的紀錄!"
End If
End If
End Sub
Private Sub Command3_Click()
Dim txtsql As String
Dim intCount As Integer
Dim MsgText As String
If msgList.Rows > 1 Then
If MsgBox("確認要刪除編號為" & Trim(msgList.TextMatrix(msgList.Row, 1)) & "的供應商記錄嗎?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intCount = msgList.Row
txtsql = "delete from 飲水機 where 飲水機編號='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
ExeSQL (txtsql)
'**********刪除與之相關的所有數據************
'txtsql = "delete from 飲水機維護表 where 飲水機編號 =" & Trim(msgList.TextMatrix(intCount, 1))
'ExeSQL (txtsql)
MsgBox "記錄刪除成功!", vbInformation, "系統提示"
Call showdata
msgList.Refresh
End If
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
Call ShowTitle
Call showdata
End Sub
'顯示Grid表頭
Public Sub ShowTitle()
Dim i As Integer
With msgList
.Cols = 6
.TextMatrix(0, 1) = "飲水機編號"
.TextMatrix(0, 2) = "飲水機名稱"
.TextMatrix(0, 3) = "零售價"
.TextMatrix(0, 4) = "供應商名稱"
.TextMatrix(0, 5) = "備注"
'固定表頭
.FixedRows = 1
'設置各列的對齊方式
For i = 0 To 5
.ColAlignment(i) = 0
Next i
'表頭項居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'設置單元大小
.ColWidth(0) = 500
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 3000
.ColWidth(5) = 5000
.Row = 1
End With
End Sub
Private Sub msgList_EnterCell()
msgList.SelectionMode = flexSelectionByRow
End Sub
Public Sub showdata()
Dim j As Integer
Dim i As Integer
Dim sqlshow As String
Dim mrc As ADODB.Recordset
sqlshow = "select * from 飲水機"
Set mrc = ExeSQL(sqlshow)
If mrc.EOF Then
frmWater.Show 1, frmWaterInfo
mrc.Close
Set mrc = Nothing
Exit Sub
End If
With msgList
.Rows = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
If Not IsNull(Trim(mrc.Fields(i - 1))) Then
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
End If
Next i
mrc.MoveNext
Loop
End With
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set frmWaterInfo = Nothing
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -