frmitem.frm

来自「ERP工程管理子系统,用于ERP编程者参考.」· FRM 代码 · 共 657 行 · 第 1/2 页

FRM
657
字号
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column22 
         DataField       =   "Remark"
         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
         BeginProperty Column02 
         EndProperty
         BeginProperty Column03 
         EndProperty
         BeginProperty Column04 
         EndProperty
         BeginProperty Column05 
         EndProperty
         BeginProperty Column06 
         EndProperty
         BeginProperty Column07 
         EndProperty
         BeginProperty Column08 
         EndProperty
         BeginProperty Column09 
         EndProperty
         BeginProperty Column10 
         EndProperty
         BeginProperty Column11 
         EndProperty
         BeginProperty Column12 
         EndProperty
         BeginProperty Column13 
         EndProperty
         BeginProperty Column14 
         EndProperty
         BeginProperty Column15 
         EndProperty
         BeginProperty Column16 
         EndProperty
         BeginProperty Column17 
         EndProperty
         BeginProperty Column18 
         EndProperty
         BeginProperty Column19 
         EndProperty
         BeginProperty Column20 
         EndProperty
         BeginProperty Column21 
         EndProperty
         BeginProperty Column22 
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   840
      Top             =   6840
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   661
      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         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      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 VB.Label LblAdd 
      BackStyle       =   0  'Transparent
      Caption         =   "添加"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   4320
      MouseIcon       =   "FrmItem.frx":0CCA
      MousePointer    =   99  'Custom
      TabIndex        =   5
      Top             =   6600
      Width           =   615
   End
   Begin VB.Image Image1 
      Height          =   300
      Left            =   3720
      Picture         =   "FrmItem.frx":0FD4
      Top             =   6600
      Width           =   300
   End
   Begin VB.Label LblModify 
      BackStyle       =   0  'Transparent
      Caption         =   "修改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   5880
      MouseIcon       =   "FrmItem.frx":13F0
      MousePointer    =   99  'Custom
      TabIndex        =   4
      Top             =   6600
      Width           =   615
   End
   Begin VB.Image Image2 
      Height          =   300
      Left            =   5280
      Picture         =   "FrmItem.frx":16FA
      Top             =   6600
      Width           =   300
   End
   Begin VB.Label LblDelete 
      BackStyle       =   0  'Transparent
      Caption         =   "删除"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   7320
      MouseIcon       =   "FrmItem.frx":1B16
      MousePointer    =   99  'Custom
      TabIndex        =   3
      Top             =   6600
      Width           =   615
   End
   Begin VB.Image Image3 
      Height          =   300
      Left            =   6720
      Picture         =   "FrmItem.frx":1E20
      Top             =   6600
      Width           =   300
   End
   Begin VB.Label LblBack 
      BackStyle       =   0  'Transparent
      Caption         =   "返回"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   8760
      MouseIcon       =   "FrmItem.frx":223C
      MousePointer    =   99  'Custom
      TabIndex        =   2
      Top             =   6600
      Width           =   615
   End
   Begin VB.Image Image4 
      Height          =   300
      Left            =   8160
      Picture         =   "FrmItem.frx":2546
      Top             =   6600
      Width           =   300
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "货号清单信息"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5160
      TabIndex        =   0
      Top             =   360
      Width           =   2535
   End
End
Attribute VB_Name = "FrmItem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()

Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc1.RecordSource = "select * from Item"
Set DataGrid1.DataSource = Adodc1

Refresh_Item

End Sub

Private Sub LblAdd_Click()
FrmItemEdit.Caption = "添加货号清单"
FrmItemEdit.Modify = False
FrmItemEdit.Show 1
Refresh_Item
End Sub

Private Sub LblBack_Click()
Unload Me
End Sub

Private Sub LblDelete_Click()
Dim TempItem As String
'保存待删除记录的ID
  TempItem = Adodc1.Recordset.Fields(1)


'弹出删除确认对话框
  If MsgBox("是否删除" + Adodc1.Recordset.Fields(1) + "?", vbYesNo, "确认") = vbYes Then
    MyItem.Delete (TempItem)
    MsgBox "删除成功"
  End If
Refresh_Item
End Sub

Private Sub LblModify_Click()

'保存待修改记录的原始ID
FrmItemEdit.OriItem = Trim(Adodc1.Recordset.Fields(1))
'把待修改信息添加到编辑窗口
  FrmItemEdit.TxtModel = Trim(Adodc1.Recordset.Fields(0))
  FrmItemEdit.TxtItem = Trim(Adodc1.Recordset.Fields(1))
  FrmItemEdit.TxtDrawing = Trim(Adodc1.Recordset.Fields(2))
  FrmItemEdit.TxtName = Trim(Adodc1.Recordset.Fields(3))
  FrmItemEdit.TxtSpecification = Trim(Adodc1.Recordset.Fields(4))
  FrmItemEdit.TxtColor = Trim(Adodc1.Recordset.Fields(5))
  FrmItemEdit.TxtUnit = Trim(Adodc1.Recordset.Fields(6))
  FrmItemEdit.CmbMB = Trim(Adodc1.Recordset.Fields(7))
  FrmItemEdit.CmbIT = Trim(Adodc1.Recordset.Fields(8))
  FrmItemEdit.CmbST = Trim(Adodc1.Recordset.Fields(9))
  FrmItemEdit.CmbInspect = Trim(Adodc1.Recordset.Fields(10))
  FrmItemEdit.TxtCapacity = Trim(Adodc1.Recordset.Fields(11))
  FrmItemEdit.TxtNWeight = Trim(Adodc1.Recordset.Fields(12))
  FrmItemEdit.TxtRWeight = Trim(Adodc1.Recordset.Fields(13))
  FrmItemEdit.TxtPackWeight = Trim(Adodc1.Recordset.Fields(14))
  FrmItemEdit.TxtPackVolume = Trim(Adodc1.Recordset.Fields(15))
  FrmItemEdit.TxtPackType = Trim(Adodc1.Recordset.Fields(16))
  FrmItemEdit.TxtPackQty = Trim(Adodc1.Recordset.Fields(17))
  FrmItemEdit.TxtProLow.Text = Trim(Adodc1.Recordset.Fields(18))
  FrmItemEdit.TxtProHigh.Text = Trim(Adodc1.Recordset.Fields(19))
  FrmItemEdit.TxtValid.Text = Trim(Adodc1.Recordset.Fields(20))
  FrmItemEdit.TxtAlarmDays.Text = Trim(Adodc1.Recordset.Fields(21))
  FrmItemEdit.TxtRemark = Trim(Adodc1.Recordset.Fields(22))
FrmItemEdit.TxtItem.Enabled = False
FrmItemEdit.Caption = "修改货号清单信息"
FrmItemEdit.Modify = True
FrmItemEdit.Show 1
Refresh_Item

End Sub
Private Sub Refresh_Item()
  Adodc1.Refresh
 If Adodc1.Recordset.RecordCount = 0 Then
 LblModify.Enabled = False
 LblDelete.Enabled = False
 Else
 LblModify.Enabled = True
 LblDelete.Enabled = True
 End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?