【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“frmMATELIST.frm”一文,供大家参考学习!
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "Msflxgrd.ocx"
Begin VB.Form frmMATELIST
Caption = "生产配料单信息
列表"
ClientHeight = 5055
ClientLeft = 45
ClientTop = 345
ClientWidth = 7845
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5055
ScaleWidth = 7845
WindowState = 2 'Maximized
Begin MSFlexGridLib.MSFlexGrid msgList
Height = 3132
Left = 240
TabIndex = 1
Top = 480
Width = 7452
_ExtentX = 13150
_ExtentY = 5530
_Version = 393216
Cols = 6
FixedCols = 5
AllowUserResizing= 1
End
Begin VB.Label lblTitle
Caption = "生 产 配 料 单 设 置 信 息 列 表"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 252
Left = 1680
TabIndex = 0
Top = 120
Width = 5532
End
End
Attribute
VB_Name = "frmMATELIST"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtSQL As String
Dim mrc As adodb.Recordset
'用户的读写权限标识
Dim mintRW As Integer
'状态条中显示的时间信息
Public msBarText As String
Public reportSQL As String
Public Sub RecordFind()
'
End Sub
Public Sub RecordRefresh()
'显示数据
msBarText = "当前数据时间范围:" & Format(DateAdd("m", -1, Now), "yyyy-mm-dd") & "至" & Format(Now, "yyyy-mm-dd")
ShowData
End Sub
Public Sub RecordAdd()
gintPLLISTmode = ADD
frmMATE.Show 0
End Sub
'删除记录
Public Sub RecordDelete()
Dim sSQL As String
Dim intCount As Integer
Dim recTemp As adodb.Recordset
Dim MsgText As String
On Error GoTo myErr
If msgList.Rows > 1 Then
If MsgBox("真的要删除编号为" & Trim(msgList.TextMatrix(msgList.Row, 1)) & "的配料单记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intCount = msgList.Row
sSQL = "delete from mate where m_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
Set recTemp = ExecuteSQL(sSQL, MsgText)
ShowData
End If
End If
Exit Sub
myErr:
ShowError
End Sub
Public Sub RecordEdit()
Dim intCount As Integer
Dim sSQL As String
Dim recTemp As adodb.Recordset
Dim MsgText As String
Dim i As Integer
If msgList.Rows > 1 Then
gintPLLISTmode = 2
intCount = msgList.Row
If intCount > 0 Then
frmMATE.txtSQL = "select m_no,wzdm2,wzmc2,jldw2,sl2,in_dj,jine,ywdm,bz from mate where m_no ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
frmMATE.txtItem(0) = Trim(msgList.TextMatrix(msgList.Row, 1))
frmMATE.txtItem(1) = Trim(msgList.TextMatrix(msgList.Row, 2))
frmMATE.txtItem(2) = Trim(msgList.TextMatrix(msgList.Row, 3))
frmMATE.Combo1(1).AddItem Trim(msgList.TextMatrix(msgList.Row, 4))
frmMATE.Combo1(1).ListIndex = 0
sSQL = "select dm,mc from dm_ywy where mc ='" & Trim(msgList.TextMatrix(intCount, 6)) & "'"
Set recTemp = ExecuteSQL(sSQL, MsgText)
If Not recTemp.EOF Then
frmMATE.Combo1(0).AddItem recTemp.Fields(1)
frmMATE.Combo1(0).ItemData(frmMATE.Combo1(0).NewIndex) = recTemp.Fields(0)
frmMATE.Combo1(0).ListIndex = 0
End If
recTemp.Close
frmMATE.txtItem(3) = Trim(msgList.TextMatrix(msgList.Row, 5))
For i = 0 To 3
frmMATE.txtItem(i).Enabled = False
Next i
For i = 0 To 1
frmMATE.Combo1(i).Enabled = False
Next i
frmMATE.Show 0
Else
MsgBox "警告", vbOKOnly + vbExclamation, "请首先选择需要修改的纪录!"
End If
Else
Call RecordAdd
End If
End Sub
Private Sub Form_Activate()
'设置读写权限
SetWorkRW mintRW
fMainForm.sbStatusBar.Panels(1).Text = msBarText
End Sub
Private Sub Form_Load()
'用户操作权限
Dim sPermission As String
Dim recTemp As Recordset
Dim sSQL As String
Dim sByte As String
Dim MsgText As String
On Error GoTo myErr
'设置操作的表名称
'msTableName = "ampaytune"
'msRptName = "paytune.rpt"
'msOrderBy = " order by tzdate,tzid"
'sOrder0 = "+ {tzdate}"
'sOrder1 = "+ {tzid}"
'msSelect = "select * from "
'置mintRW初值
mintRW = 0
sSQL = "select rw from per
mission where module=12 and id='" & sUserName & " '"
Set recTemp = ExecuteSQL(sSQL, MsgText)
If recTemp.EOF = False Then
mintRW = CInt(recTemp!rw)
Else
mintRW = ERRORMODE
SetMdiEnv
MsgBox "您的帐号权限有错误!", vbOKOnly + vbCritical, "错误"
Exit Sub
End If
'设置msSql
'msSql = msSelect & msTableName & " where tzdate>='" & Format(DateAdd("m", -1, Now), "yyyy-mm-dd") & "' and tzdate<='" & Format(Now, "yyyy-mm-dd") & "'" & msOrderBy
'显示数据
msBarText = "当前数据时间范围:" & Format(DateAdd("m", -1, Now), "yyyy-mm-dd") & "至" & Format(Now, "yyyy-mm-dd")
ShowTitle
ShowData
Set recTemp = Nothing
Exit Sub
myEr