⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form_product_bak.frm

📁 仓库扫描管理系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form_product_bak 
   BackColor       =   &H00C0FFFF&
   Caption         =   "物料登记"
   ClientHeight    =   4125
   ClientLeft      =   1110
   ClientTop       =   345
   ClientWidth     =   5820
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   4125
   ScaleWidth      =   5820
   Begin VB.CommandButton cmdClose 
      Caption         =   "&C关闭"
      Height          =   315
      Left            =   4560
      TabIndex        =   21
      Top             =   3135
      Width           =   975
   End
   Begin VB.CommandButton cmdUpdate 
      Caption         =   "&S保存"
      Height          =   315
      Left            =   3480
      TabIndex        =   20
      Top             =   3135
      Width           =   975
   End
   Begin VB.CommandButton cmdRefresh 
      Caption         =   "&R刷新"
      Height          =   315
      Left            =   2400
      TabIndex        =   19
      Top             =   3135
      Width           =   975
   End
   Begin VB.CommandButton cmdDelete 
      Caption         =   "&D删除"
      Height          =   315
      Left            =   1320
      TabIndex        =   18
      Top             =   3135
      Width           =   975
   End
   Begin VB.CommandButton cmdAdd 
      Caption         =   "&A新增"
      Height          =   315
      Left            =   240
      TabIndex        =   17
      Top             =   3135
      Width           =   975
   End
   Begin VB.Data Data1 
      Align           =   2  'Align Bottom
      Connect         =   "Access"
      DatabaseName    =   "E:\datum\应用软件\物流管理\warehouse\DB-Access\hunterPOS-new.mdb"
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   0
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "hpos_products"
      Top             =   3780
      Width           =   5820
   End
   Begin VB.TextBox txtFields 
      DataField       =   "comment"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   8
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   8
      Top             =   2640
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productStd"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   6
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   6
      Top             =   1920
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "price"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   7
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   7
      Text            =   "0.00"
      Top             =   2280
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productUnit"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   5
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   5
      Top             =   1560
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productSpecs"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   4
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   4
      Top             =   1200
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productModel"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   3
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   3
      Top             =   840
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productName"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   2
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   2
      Top             =   480
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productCode"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   1
      Left            =   2040
      MaxLength       =   50
      TabIndex        =   1
      Top             =   120
      Width           =   3375
   End
   Begin VB.TextBox txtFields 
      DataField       =   "productId"
      DataSource      =   "Data1"
      Height          =   285
      Index           =   0
      Left            =   2040
      TabIndex        =   0
      Top             =   3000
      Visible         =   0   'False
      Width           =   1935
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "备注:"
      Height          =   255
      Index           =   9
      Left            =   120
      TabIndex        =   16
      Top             =   2640
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "产品标准:"
      Height          =   255
      Index           =   7
      Left            =   120
      TabIndex        =   15
      Top             =   1920
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "单    价:"
      Height          =   255
      Index           =   6
      Left            =   120
      TabIndex        =   14
      Top             =   2280
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "单    位:"
      Height          =   255
      Index           =   5
      Left            =   120
      TabIndex        =   13
      Top             =   1560
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "规    格:"
      Height          =   255
      Index           =   4
      Left            =   120
      TabIndex        =   12
      Top             =   1200
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "型    号:"
      Height          =   255
      Index           =   3
      Left            =   120
      TabIndex        =   11
      Top             =   840
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "名    称:"
      Height          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   10
      Top             =   480
      Width           =   1815
   End
   Begin VB.Label lblLabels 
      BackColor       =   &H00C0FFFF&
      Caption         =   "编    号:"
      Height          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   9
      Top             =   120
      Width           =   1815
   End
End
Attribute VB_Name = "form_product_bak"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdAdd_Click()
  Data1.Recordset.AddNew
  txtFields(1).SetFocus
End Sub

Private Sub cmdDelete_Click()
  'this may produce an error if you delete the last
  'record or the only record in the recordset
  If MsgBox("真的要删除吗?", vbYesNo) = vbYes Then
    Data1.Recordset.Delete
    Data1.Recordset.MoveNext
  End If
End Sub

Private Sub cmdRefresh_Click()
  'this is really only needed for multi user apps
  Data1.Refresh
End Sub

Private Sub cmdUpdate_Click()
  Data1.UpdateRecord
  Data1.Recordset.Bookmark = Data1.Recordset.LastModified
  MsgBox "保存成功!", vbInformation
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub

Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  'This is where you would put error handling code
  'If you want to ignore errors, comment out the next line
  'If you want to trap them, add code here to handle them
  MsgBox "Data error event hit err:" & Error$(DataErr)
  Response = 0  'throw away the error
End Sub

Private Sub Data1_Reposition()
  Screen.MousePointer = vbDefault
  On Error Resume Next
  'This will display the current record position
  'for dynasets and snapshots
  Data1.Caption = "第 " & (Data1.Recordset.AbsolutePosition + 1) & " 条记录!"
  'for the table object you must set the index property when
  'the recordset gets created and use the following line
  'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
End Sub

Private Sub Data1_Validate(Action As Integer, Save As Integer)
  'This is where you put validation code
  'This event gets called when the following actions occur
  Select Case Action
    Case vbDataActionMoveFirst
    Case vbDataActionMovePrevious
    Case vbDataActionMoveNext
    Case vbDataActionMoveLast
    Case vbDataActionAddNew
    Case vbDataActionUpdate
    Case vbDataActionDelete
    Case vbDataActionFind
    Case vbDataActionBookmark
    Case vbDataActionClose
  End Select
  Screen.MousePointer = vbHourglass
End Sub

Private Sub Form_Load()
  Data1.DatabaseName = g_dbPath
'  If Not Data1.Recordset.EOF Then
'     txtFields(1).SetFocus
'  End If
  Me.Left = (Screen.Width - Me.Width) / 2
  Me.Top = (Screen.Height - Me.Height) / 2
End Sub

Private Sub Form_Unload(Cancel As Integer)
  frm_main.Enabled = True
  Screen.MousePointer = vbDefault
End Sub

Private Sub txtFields_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyReturn Then     '按回车键
   If (Index < 8) Then
      txtFieldGetFocus (Index + 1)
    End If
    If (Index = 8) Then
      cmdUpdate.SetFocus
    End If
 End If
End Sub

Private Sub txtFieldGetFocus(i As Integer)
        txtFields(i).SelStart = 0
        txtFields(i).SelLength = Len(txtFields(i).Text)
        txtFields(i).SetFocus

End Sub

⌨️ 快捷键说明

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