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

📄 sys_gksz.frm

📁 基于SQL2000的企业管理MRPII,包含进销存,财务,报关等组件,VB6开发,带文档说明.
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Name            =   "Arial"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   3195
         TabIndex        =   17
         Top             =   330
         Width           =   1155
      End
   End
   Begin MSAdodcLib.Adodc AdoprimaryRs 
      Height          =   495
      Left            =   1800
      Top             =   240
      Width           =   3375
      _ExtentX        =   5953
      _ExtentY        =   873
      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         =   "AdoprimaryRs"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "PMingLiU"
         Size            =   9
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
End
Attribute VB_Name = "Sys_GKSZ"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As Recordset
Dim bh As String

'*******************************************************
'*            曹汉华 2002.8.28.晚                      *
'*******************************************************
Private Sub cmdnext_Click() '向后

  On Error GoTo GoNextError
  If Not AdoprimaryRs.Recordset.EOF Then AdoprimaryRs.Recordset.MoveNext
  If AdoprimaryRs.Recordset.EOF And AdoprimaryRs.Recordset.RecordCount > 0 Then
    Beep
    AdoprimaryRs.Recordset.MoveLast
  End If
  
  Exit Sub
GoNextError:
  MsgBox Err.Description

End Sub

Private Sub Cmdqd_Click() '首端
  If AdoprimaryRs.Recordset.RecordCount > 0 Then
  If AdoprimaryRs.BOFAction = False Then
  AdoprimaryRs.Recordset.MoveFirst
  Else
  AdoprimaryRs.Recordset.MoveNext
  End If
  Else
  Exit Sub
  End If
  End Sub

Private Sub Cmdreturn_Click()
Unload Me
End Sub
Private Sub cmdxq_Click() '向前
  On Error GoTo GoPrevError
  If Not AdoprimaryRs.Recordset.BOF Then AdoprimaryRs.Recordset.MovePrevious
  If AdoprimaryRs.Recordset.BOF And AdoprimaryRs.Recordset.RecordCount > 0 Then
    Beep
    AdoprimaryRs.Recordset.MoveFirst
  End If
  
  Exit Sub
GoPrevError:
  MsgBox Err.Description
End Sub

Private Sub cmdmd_Click() '末端
 If AdoprimaryRs.Recordset.RecordCount > 0 Then
 If AdoprimaryRs.Recordset.EOF = False Then
    AdoprimaryRs.Recordset.MoveLast
    Else
    AdoprimaryRs.Recordset.MovePrevious
 End If
 Else
 Exit Sub
 End If
End Sub



Private Sub Form_Load() '列表框数据
Me.Width = main_FRM.Picture1.Width - 30
 Me.Top = main_FRM.ActiveBar21.Bands("Band7").Height * 2.5 - 65
 Me.Height = main_FRM.Picture1.Height - 300
 Me.Left = main_FRM.Picture1.Left + 15
 Cmdcancel.Enabled = False
 CmdOK.Enabled = False

  AdoprimaryRs.ConnectionString = Conn_Str
  AdoprimaryRs.RecordSource = "select * FROM sys_gksz"
  AdoprimaryRs.Refresh
 
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If Cmdcancel.Enabled = True Then
If UnloadMode <> VBRUN.QueryUnloadConstants.vbFormCode Then
Cancel = 1
Exit Sub
End If
End If
End Sub

Private Sub text_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then        '向下箭头
   If Index + 1 < Text.Count Then
   Text(Index + 1).SetFocus
   Else
   Text(0).SetFocus
  End If
End If
If KeyCode = 38 Then        '向上箭头
  If Index - 1 >= 0 Then
  Text(Index - 1).SetFocus
  Else
  Text(Text.Count - 1).SetFocus
  End If
End If
End Sub

Private Sub Text_KeyPress(Index As Integer, KeyAscii As Integer)
   If KeyAscii = 13 Then    ' 按回车
      KeyAscii = 0
      SendKeys "{TAB}"
   End If
End Sub
Private Sub Cmdadd_Click()   '添加
 ' On Error Resume Next
  For i = 0 To Text.Count - 1
      Text(i).Locked = False
  Next i
   cmdqd.Enabled = False
  cmdxq.Enabled = False
  cmdmd.Enabled = False
  cmdnext.Enabled = False
  Cmddelete.Enabled = False
  Cmdadd.Enabled = False
  Cmdedit.Enabled = False
  Cmdreturn.Enabled = False
  CmdOK.Enabled = True
  Cmdcancel.Enabled = True
  Set rs = New Recordset
  rs.Open "select gkbh from sys_gksz order by gkbh ", DB, adOpenStatic, adLockOptimistic
  If rs.RecordCount < 1 Then
   bh = "0001"
   Else
   rs.MoveLast
   bhx = Trim(Str(Val(Right(rs.Fields("gkbh").Value, 4)) + 1))
   If Len(bhx) = 1 Then
     bh = "000" & bhx
   End If
   If Len(bhx) = 2 Then
   bh = "00" + bhx
   End If
   If Len(bhx) = 3 Then
   bh = "0" + bhx
   End If
   If Len(bhx) = 4 Then
   bh = bhx
   End If
 End If
  If AdoprimaryRs.Recordset.RecordCount > 0 Then
  AdoprimaryRs.Recordset.MoveLast
  End If
  AdoprimaryRs.Recordset.AddNew
 Text(0).Text = "P" + Trim(bh)
'AddErr:
 ' MsgBox Err.Description
End Sub

Private Sub cmdDelete_Click() '删除
If MsgBox("是否真的删除当前记录 ?", vbYesNo + 32, "系统提示") = vbYes Then
  On Error Resume Next
  With AdoprimaryRs
    .Recordset.Delete
    .Recordset.MoveNext
    If .Recordset.EOF Then .Recordset.MoveFirst
  End With
End If
End Sub

Private Sub cmdEdit_Click() '修改
  For i = 0 To Text.Count - 1
      Text(i).Locked = False
  Next i
   cmdqd.Enabled = False
  cmdxq.Enabled = False
  cmdmd.Enabled = False
  cmdnext.Enabled = False
  Cmddelete.Enabled = False
  Cmdadd.Enabled = False
  Cmdedit.Enabled = False
  Cmdreturn.Enabled = False
  CmdOK.Enabled = True
  Cmdcancel.Enabled = True
  On Error GoTo EditErr
 
  Exit Sub
EditErr:
  MsgBox Err.Description
End Sub
Private Sub cmdCancel_Click() '取消
  For i = 0 To Text.Count - 1
      Text(i).Locked = True
  Next i
  cmdqd.Enabled = True
  cmdxq.Enabled = True
  cmdmd.Enabled = True
  cmdnext.Enabled = True
  Cmddelete.Enabled = True
  Cmdadd.Enabled = True
  Cmdedit.Enabled = True
  Cmdreturn.Enabled = True
  CmdOK.Enabled = False
  Cmdcancel.Enabled = False
  On Error Resume Next
  AdoprimaryRs.Recordset.CancelUpdate
  If mvBookMark > 0 Then
    AdoprimaryRs.Recordset.Bookmark = mvBookMark
  Else
    AdoprimaryRs.Recordset.MoveFirst
  End If
  End Sub

Private Sub cmdOK_Click()    '确认
If Text(0).Text = "" Then
   MsgBox "编号或名称不能为空", 48, "提示"
   Text(0).SetFocus
   Exit Sub
End If
If Text(1).Text = "" Then
   MsgBox "编号或名称不能为空", 48, "提示"
   Text(0).SetFocus
   Exit Sub
End If
If Text(2).Text = "" Then
   Text(2).Text = "  "
End If
If Text(3).Text = "" Then
   Text(3).Text = "  "
End If
If Text(4).Text = "" Then
   Text(4).Text = "  "
End If
  For i = 0 To Text.Count - 1
      Text(i).Locked = True
  Next i
  cmdqd.Enabled = True
  cmdxq.Enabled = True
  cmdmd.Enabled = True
  cmdnext.Enabled = True
  Cmddelete.Enabled = True
  Cmdadd.Enabled = True
  Cmdedit.Enabled = True
  Cmdreturn.Enabled = True
  CmdOK.Enabled = False
  Cmdcancel.Enabled = False
  On Error Resume Next
  AdoprimaryRs.Recordset.UpdateBatch adAffectAll
  If AdoprimaryRs.Recordset.BOF = False Then
    AdoprimaryRs.Recordset.MovePrevious
    AdoprimaryRs.Recordset.MoveNext
  End If
  If AdoprimaryRs.Recordset.BOF = True Then
    AdoprimaryRs.Recordset.MoveNext
    AdoprimaryRs.Recordset.MovePrevious
  End If
  Cmdcancel.Enabled = False
  CmdOK.Enabled = False
  'Call list_load
End Sub





⌨️ 快捷键说明

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